i have two models crm.store in which i have declared thoses two fields
name = fields.Char(string="Name store")
id_store = fields.Char(string="ID store")
and crm.unit which in which i have the fallowing fields
st_or_id = fields.Char(string="ID")
store = fields.Many2one('crm.store', string='Store')
store_id = fields.Char(related='store.id_store', string='Store ID)
i want when i give the st_or_id, the store field will be feed up with the store name that has the same id of id_store
for that i tried in my xml
<field name="store_id " invisible="1"/>
<field name="st_or_id "/>
<field name="store" domain="[('st_or_id ', '=', store_id)]"/>
i want to know how could i acheive this, using an onchange function.
i tried that , to applie the domain on the store field
@api.onchange('st_or_id')
def onchange_store_id(self):
return {'domain': {'store': [('st_or_id', '=', 'store_id')]}}
but it dosent work