summaryrefslogtreecommitdiff
path: root/odoo/addons
diff options
context:
space:
mode:
authorWilliam Henrotin <whe@odoo.com>2021-03-05 14:02:26 +0000
committerWilliam Henrotin <whe@odoo.com>2021-03-08 15:58:24 +0000
commitb16413a5d2072efcae619f968ea9f772f6654efa (patch)
tree57f0fe62b3d371a5f00054eb70985976451ee98f /odoo/addons
parent732e581f38e8f93f26892ac445493694933ff61a (diff)
[IMP] base: use of float_compare in server actions
This commit gives access to float_compare function in server action python code. closes odoo/odoo#67490 X-original-commit: 3046b11f50aa1a0e02725492ba63b17c194db751 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com> Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Diffstat (limited to 'odoo/addons')
-rw-r--r--odoo/addons/base/models/ir_actions.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/odoo/addons/base/models/ir_actions.py b/odoo/addons/base/models/ir_actions.py
index caba0b44a88..10cef4daf53 100644
--- a/odoo/addons/base/models/ir_actions.py
+++ b/odoo/addons/base/models/ir_actions.py
@@ -6,6 +6,7 @@ from odoo import api, fields, models, tools, SUPERUSER_ID, _
from odoo.exceptions import MissingError, UserError, ValidationError, AccessError
from odoo.osv import expression
from odoo.tools.safe_eval import safe_eval, test_python_expr
+from odoo.tools.float_utils import float_compare
import base64
from collections import defaultdict
@@ -74,6 +75,7 @@ class IrActions(models.Model):
'datetime': tools.safe_eval.datetime,
'dateutil': tools.safe_eval.dateutil,
'timezone': timezone,
+ 'float_compare': float_compare,
'b64encode': base64.b64encode,
'b64decode': base64.b64decode,
}
@@ -381,6 +383,7 @@ class IrActionsServer(models.Model):
# - record: record on which the action is triggered; may 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: Odoo function to compare floats based on specific precisions
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
# - UserError: Warning Exception to use with raise
# To return an action, assign: action = {...}\n\n\n\n"""