Skip to Content

Window Action

A Window Action in Odoo is a feature that allows you to create a custom view that displays records from a specific model, along with predefined actions that can be performed on those records.
Window Actions are typically used to provide quick access to frequently used views or to streamline certain workflows. With Window Actions, you can create custom views with specific filters, predefined actions, and default field values, allowing users to perform common actions more efficiently.
For example, you can create a Window Action for Sales Orders that displays only the draft orders and allows the user to perform common actions, such as confirm or cancel the order, with just a click.
Window Actions are created and managed through the backend panel in Odoo. Once created, they can be used in various parts of the Odoo application, such as the main menu, the kanban view, or the calendar view.
Step 1: Login to Odoo and navigate to the "Settings" menu
Log in to your Odoo instance using valid credentials. Once you are logged in, navigate to the "Settings" menu on the top right corner of the screen.
Step 2: Access the "Actions" menu
Under the "Settings" menu, click on the "Technical" submenu and select "Actions" from the drop-down list.
Step 3: Create a new action
On the "Actions" page, click on the "Create" button to create a new action.
Step 4: Choose "Window Action"
In the "Create Action" dialog box, select "Window Action" from the "Action Type" drop-down list.
Step 5: Name the Window Action
Give a name to your Window Action. For example, you can name it "My Window Action".
Step 6: Select the model for the action
Under the "Action Definition" tab, select the model on which you want to create this action. For example, you can select "Sales Orders" if you want to create an action related to sales orders.
Step 7: Choose the view type
Set the view type to "List View" or "Form View" depending on the type of view you want to create.
Step 8: Select the view
Select the view you want to use for this action. If you want to create a custom view, you can create it first and then select it from the list.
Step 9: Set the default field values
Under the "Context" tab, you can specify the default values for any field that you want to set when the action is triggered. For example, if you want to set the default value for the "partner_id" field to a specific customer, you can do that here.
Step 10: Set the domain for the view
Under the "Domain" tab, you can set the domain for the records that you want to show in the view. For example, you can set a domain to show only those sales orders whose status is "Draft".
Step 11: Set the action to be performed
Under the "Action" tab, you can specify what action you want to perform when the user clicks on a record in the view. You can choose from a range of actions, such as "Open Form", "Open Tree View", "Create New Record", "Execute Python Code", etc.
Step 12: Save the Window Action
Finally, click on the "Save" button to create the Window Action.
Step 13: Use the Window Action in different parts of Odoo
Now that you have created the Window Action, you can use it in different parts of the Odoo application. For example, you can add it to the main menu, the kanban view, the calendar view, etc. To do that, navigate to the specific view where you want to add the action, click on the "Customize" button, and then drag and drop the action onto the view.
That's it! You have successfully created a Window Action in Odoo 15 using the backend panel, and now you know how to use it in different parts of the application.



Rating
0 0

There are no comments for now.

to be the first to leave a comment.