Ich habe ein neues stock.location
wie diese auf einem benutzerdefinierten Modul definiert:Anruf spezifisch auf Anfrage Standort in geerbt Modell - Odoo v9 Community
<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>
Nun möchte ich auf zwei Feldern diesen Standort als Standard festlegen, mit die neue API, wie folgt aus:
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.")
Mit dem default
Attribut, jetzt, in diesem Moment erscheint dies auf dem Formular leer.
Natürlich, ich bin nicht die Lage in der richtigen Art und Weise aufrufen, so, wie kann ich anrufen, oder besser, was das Äquivalent sein, von:
ref="stock.stock_location_locations_virtual"
Auf diesem Fall?
Ich habe in der stock_location
DB Tabelle gesucht, aber ich habe wirklich keine Ahnung.
Irgendwelche Ideen?
EDIT
Ich habe auch so versucht:
def _static_location(self):
return ReparacionUnidades
Dann auf default
Attribut aufrufen, um dieses _static_location
Objekt, aber ReparacionUnidades
ist offensichtlich nicht definiert.
LoL, Alter, wie ich das nicht bemerkt habe, Vielen Dank. – NeoVe