In the wizard I added a field product_id, and button.
When choosing the product and clicking on button I want to get the stock.quant tree view of the product.
How to pass value in context ?
class Wizard(models.TransientModel):
_name = 'wizard.wizard'
product_id = fields.Many2one('product.product', string="Product")
@api.model
def my_button(self):
return {
'name': _('Products'),
'view_type': 'tree',
'view_mode': 'list',
'res_model': 'stock.quant',
'context': {},
'type': 'ir.actions.act_window',
'target': 'new',
}