Hi,
I am using odoo15 community edition, and I am trying to launch a wizard from purchase order based on changes on purchase order lines when I use the function below, it does return nothing:
_inherit = 'purchase.order.line'
@api.onchange('product_id')
def open_wizard(self):
if self.product_id.is_kits:
return {
'name': 'Add components',
'type': 'ir.actions.act_window',
'view_mode': 'form',
'res_model': 'add.components.wizard',
'target': 'new'
}
I would like to know if it is possible to do this without using a button