Search code examples
odooodoo-9

I want Odoo 9 no hide wizard on button click


Is it possible disable close wizard on button click in odoo 9, only allow close on X in right corner of wizard. I want on button call function and populate field in wizard!


Solution

  • If you're using buttons of type object there is the possibility to return an action, which should open the wizard again:

    @api.multi
    def my_button_method(self):
        # my logic
        return {
            'type': 'ir.actions.act_window',
            'view_mode': 'form',
            'res_model': 'my.wizard.model',
            'target': 'new',
            'res_id': self.id,
        }