Display Confirmation Message Dialog Box in Odoo
For example we have some document which needs to be approved by higher authorities of a company. And before submitting it to we want to ask confirmation from user. So guys to achieve this goal follow these steps.Read More: How to Send Email on Button Click in Odoo
show_message_box_odoo.py
Code Description
In above code we created a class named "display_dialog_box", and in that class we create one field named "text" this field holds our text message that we want to display our user before taking some action on button click.Now we are going to create our dialog box / message box interface. In Odoo/ERP its not a big deal if you don't have any idea about form view than read.
Read More: How to Create Form and Tree View in Odoo
show_message_box_odoo.xml
Code Description
In above code we have created form view to display confirmation message box. This form view contains one field that will display our confirmation message and a footer that contains tow buttons, the first one is for "Yes", "Ok" and the second one is for cancellation of the form.Now that we have class and form view associated to that class. Now in above code after view we have created action menu for that model or class, because when we click on button than this action menu will popup or open dialog box or message confirmation box.
Read More: How to Create Window Action and Menu Item in Odoo
Now its time to open dialog box on button click.
0 Comments