env
: environment on which the action is triggeredmodel
: model of the record on which the action is triggered; is a void recordsetrecord
: record on which the action is triggeredrecords
: recordset of all records on which the action is triggered in multi modetime
, datetime
, dateutil
, timezone
: useful Python librariesfloat_compare()
: utility function to compare floats based on a specific precisionIf 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 triggeredmodel
: model of the record on which the action is triggered; is a void recordsetrecord
: record on which the action is triggered; may be be voidrecords
: recordset of all records on which the action is triggered in multi mode; may be voidtime
, datetime
, dateutil
, timezone
: useful Python librariesfloat_compare()
: utility function to compare floats based on a specific precisionlog(message, level='info')
: logging function to record debug information in ir.logging
table_logger.info(message)
: logger to emit messages in server logsUserError
: exception class for raising user-facing warning messagesCommand
: x2many commands namespaceaction = {...}
Example of Python code:
partner_name = record.name + '_code' env['res.partner'].create({'name': partner_name})