I am trying to update a context from onchange method. Below is code reference-
@api.onchange('country') def country(self): """verify country.""" self = self.with_context(flag = True) @api.onchange('state') def state(self): """verify state.""" print self.env.context
When def country is called i am able to print flag=True in context But when def state method is called i m unable to get flag=True
Also below if my xml code to hide field using context
field name="productname" invisible="context.get('flag', True)"
But flag=True unable to locate under context!!
How i can fix it?