0
私はカスタムモジュールこのような新しいstock.location
に定義した:コール特定の株式の場所 - Odoo V9コミュニティ
<record id="location_stock" model="stock.location">
<field name="name">ReparacionUnidades</field>
<field name="location_id" ref="stock.stock_location_locations_virtual"/>
<field name="usage">production</field>
<field name="company_id"></field>
</record>
、私は、二つのフィールドにデフォルトとしてこの場所を設定したいですこのような新しいAPI、:default
属性で
x_location_src_id = fields.Many2one('stock.location', string=u'Ubicacion Origen de Productos', required=True,
readonly=False, default='ReparacionUnidades',
help="Location where the system will look for components.")
x_location_dest_id = fields.Many2one('stock.location', string=u'Ubicacion Destino de Productos', required=True,
readonly=False, default='ReparacionUnidades',
help="Location where the system will look for components.")
は、今、この瞬間に、これはフォームの空表示されます。この場合には
ref="stock.stock_location_locations_virtual"
:
もちろん、私は、そう、私が呼ぶ、またはより良いことができますどのように、何が同等になり、正しい方法で場所を呼び出していませんよ?
私はstock_location
DBテーブルを検索しましたが、本当に私はヒントを持っていません。
アイデア?
EDIT
私はまた、このように試してみた:、default
属性にこの_static_location
オブジェクトを呼び出し、その後
def _static_location(self):
return ReparacionUnidades
を、しかしReparacionUnidades
は明らかに定義されていません。
LoL、おい、どうして気づかなかったか、ありがとう。 – NeoVe