Hello,
I try to open a view from an onchange event. If the user selecting a country i want to check if there is set an information on this record. if this information is not set i want to open the view to enter them.
My model is this:
class e_template(models.Model):
......
Country = fields.Many2one('res.country', string="Location of the Item", default=58)
@api.onchange('Country')
def _onchange_Country(self):
if self.Country.EbayShortCut == False:
res = {
"type": "ir.actions.act_window",
"res_model": "res_country",
"views": [[False, "form"]],
"res_id": self.Country,
"target": "new",
}
logging.info(res)
return res
.....
How to i open the form view in an onchange event. It would be nice to get some help.
thx michael