ir.actions.actions ir.actions.actions
ir.actions.actions.tree ir.actions.actions ir.actions.actions.search ir.actions.actions Actions ir.actions.actions ir.actions.report ir.actions.report
ir.actions.report.tree ir.actions.report ir.actions.report.search ir.actions.report Reports ir.actions.report ir.actions.client.form ir.actions.client
ir.actions.windows.tree ir.actions.act_window ir.actions.windows.form ir.actions.act_window
ir.actions.windows.search ir.actions.act_window Window Actions ir.actions.act_window tree form Client Actions ir.actions.client Client Actions ir.actions.client Server Action ir.actions.server

by to Set a value... to this Python expression:
Available variables:
  • env: environment on which the action is triggered
  • model: model of the record on which the action is triggered; is a void recordset
  • record: record on which the action is triggered
  • records: recordset of all records on which the action is triggered in multi mode
  • time, datetime, dateutil, timezone: useful Python libraries
  • float_compare(): utility function to compare floats based on a specific precision

If several child actions return an action, only the last one will be executed. This may happen when having server actions executing code that returns an action, or server actions returning a client action.

The following variables can be used:

  • env: environment on which the action is triggered
  • model: model of the record on which the action is triggered; is a void recordset
  • record: record on which the action is triggered; may be be void
  • records: recordset of all records on which the action is triggered in multi mode; may be void
  • time, datetime, dateutil, timezone: useful Python libraries
  • float_compare(): utility function to compare floats based on a specific precision
  • log(message, level='info'): logging function to record debug information in ir.logging table
  • _logger.info(message): logger to emit messages in server logs
  • UserError: exception class for raising user-facing warning messages
  • Command: x2many commands namespace
  • To return an action, assign: action = {...}

Example of Python code:

partner_name = record.name + '_code'
env['res.partner'].create({'name': partner_name})
    
Server Actions ir.actions.server ir.actions.server.search ir.actions.server Server Actions ir.actions.server tree,form {'key':'server_action'} ir.actions.todo Config Wizard Steps