Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
2424 Ansichten

Hi,

I would like to create a modal with two buttons within the account.move model. I have already inherited the model and added a custom button.

Now, my goal is to open a modal that includes a title, some text, and two buttons that perform simple actions.

Inside my model py 

i have something like this

def open_custom_modal(self):
return {
'type': 'ir.actions.client',
'target': 'new',
'tag': 'custom_modal',
'params': {
'title': 'Important Message',
'body': 'This is an important message that needs to be displayed to the user.',

},
}


What i'm doing wrong?

Avatar
Verwerfen
Beste Antwort

Hi 

 You can open a wizard in that button add the two buttons inside the wizard and write the button functionality inside that transientmodel of wizard.

return {
            'type': 'ir.actions.act_window',
            'name': 'Modal Title',
            'res_model': 'my.modal',
            'view_mode': 'form',
            'target': 'new',
        }

Check these 

Launch Wizard from a Button in Odoo

Create Wizard in Odoo 17


Regards


Avatar
Verwerfen