Skip to Content
Menu
This question has been flagged
3 Replies
9178 Views

What is the difference between server actions and client actions in Odoo?

Avatar
Discard
Best Answer

Hi, 

 1. Server Action(ir.actions.server)

Server Actions work on the base model and provide different types of actions that can be executed automatically.

For example, if you want to add actions to the More context menu and use basic action rules. 

Available server actions are: 

1. Python code execution: - A block of Python code is executed.

2. Create New Record: - Create a new record with new values.

3. Write to the record: - update the value of the record. 

4. Perform some actions: - Define actions that trigger other server actions.


2. Client Action( ir.actions.client)

Client actions are used to trigger actions that are fully implemented on the client.

tag: client-side identifier for the action, an arbitrary string that the client needs to know how to respond.

params: A Python dictionary containing additional data to be sent to the client along with the client action tag

target:

Target options are,

current: Used to open the main content area.

new: it is used to open the window like a popup.

full screen: it is used to open a window in fullscreen mode.

main: It is used to open the main content area without breadcrumbs.


For more information refer the blog:

https://www.cybrosys.com/blog/type-of-actions-in-odoo-16-erp


Hope it helps

Avatar
Discard
Best Answer

Reply : In Odoo, server actions and client actions are two different types of actions that can be defined and triggered within the system. Here's the difference between them

Server Actions:
Server actions are executed on the server-side of Odoo.
They are defined using Python code and can perform complex server-side operations.
Server actions are triggered by events like button clicks, automated actions (cron jobs), or workflow transitions.
They can modify records, execute business logic, send emails, generate reports, update fields, and perform other server-side tasks.
Server actions are typically used for batch operations, data manipulation, or triggering complex workflows.

Client Actions:
Client actions are executed on the client-side of Odoo, which means they are executed within the user's web browser.
They are defined using JavaScript code and are used to enhance the user interface and provide interactive features.
Client actions are triggered by user events like button clicks, menu selections, or other user interactions.
They can manipulate the user interface, show/hide elements, perform validations, make API calls, and provide dynamic behavior.
Client actions are often used for user experience improvements, such as adding dynamic fields, triggering pop-up windows, or updating interface elements without page reloads.

Regards,

Ksolves Team!

Avatar
Discard
Best Answer

HI,

Server Action:
A server action in Odoo is executed on the server-side, typically triggered by an event such as a button click or an automated workflow. It is written in Python code and allows you to define complex business logic and perform operations on the server.



Client Action:
A client action in Odoo refers to an action performed on the client-side, typically within the user interface (UI) of the web browser. It is written in JavaScript and allows you to define interactive behaviors and perform actions without communicating with the server.



Odoo documentation: https://www.odoo.com/documentation/16.0/developer/reference/backend/actions.html


Thanks

Avatar
Discard
Related Posts Replies Views Activity
2
Nov 23
1710
0
Mar 15
3060
2
Mar 15
6195
1
May 25
198
0
May 25
194