Odoo developement tutorials – Types of Actions in Odoo
Server Actions (ir.actions.server)
class odoo.addons.base.models.ir_actions.IrActionsServer(pool, cr)
Server actions model. Server action work on a base model and offer various type of actions that can be executed automatically, for example using base action rules, of manually, by adding the action in the ‘More’ contextual menu.
Since Odoo 8.0 a button ‘Create Menu Action’ button is available on the action form view. It creates an entry in the More menu of the base model. This allows to create server actions and run them in mass mode easily through the interface.
The available actions are :
‘Execute Python Code’: a block of python code that will be executed
‘Create a new Record’: create a new record with new values
‘Write on a Record’: update the values of a record
‘Execute several actions’: define an action that triggers several other server actions
Allow triggering complex server code from any valid action location. Only two fields are relevant to clients:
id
the in-database identifier of the server action to run
context (optional)
context data to use when running the server action
In-database records are significantly richer and can perform a number of specific or generic actions based on their state. Some fields (and corresponding behaviors) are shared between states:
model_id
Odoo model linked to the action.
state
code: Executes python code given through the code argument.
object_create: Creates a new record of model crud_model_id following fields_lines specifications.
object_write: Updates the current record(s) following fields_lines specifications
multi: Executes serveral actions given through the child_ids argument.
#odoodevelopment #odootutorials #odoo13
For More Videos Subscribe to our YouTube channel.
Visit our company website:
Connect with us:
Facebook:
twitter:
LinkedIn:
Pinterest:
#Odoo #Development #Server #Actions #Odoo