Adding a Button Inside the Action Menu in Odoo 17

HISHAM
February 8, 2024
actons-menu-in-odoo

In Odoo 17, the Action Menu is the main location where you can perform different actions on records. This menu’s user processes can be greatly improved by adding a custom button that gives users rapid access to particular functionalities. This customization makes the user experience more efficient and straightforward while also streamlining procedures.

You can change an action for a single record or a group of records using the action menu button. The button shows up in the form view and tree view of the Odoo action. A button can be added inside the form view if we just want to make changes to a single record. If not, we may add a button within the tree view to handle many or particular records.

Here’s an example of how to add an “Update Order Date” button to the action menu so that the selling order date is updated to the current date.

Step 1: To update the sale order date to the current date, create a module with the Python function included.

pythom-function

Step 2: Add the following action to the XML file.

actions-in-odoo-17

The “Update Order Date” action under the Action menu will appear as a result of this code, as seen in the figure.

Action-menu

As seen in the example, the order date field’s value is 10/27/2023 before selecting the “Update Order Date” option. We can see that the Order date has been modified after clicking it.

This button was simply added to the form view. We can modify the binding_view_types to form and tree, as seen below if we want the button to show up in both the form and tree view.

tree-view-in-odoo
actions-in-odoo

A quick and easy approach to customize Odoo 17 to meet your unique requirements is to modify the Action Menu. You may increase user productivity and streamline access to necessary features by adding a custom button.

"Unlock the Full Potential of Your Business with Odoo ERP!"

"Get a Cost Estimate for Your ERP Project, Absolutely FREE!"

Get a Free Quote

Leave a Reply

Your email address will not be published. Required fields are marked *