[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#67500 X-original-commit: 3046b11f50aa1a0e02725492ba63b17c194db751 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com> Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
This commit is contained in:
@@ -6,6 +6,7 @@ from odoo import api, fields, models, tools, SUPERUSER_ID, _, Command
|
||||
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,
|
||||
'Command': Command,
|
||||
@@ -382,6 +384,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
|
||||
# - Command: x2Many commands namespace
|
||||
|
||||
Reference in New Issue
Block a user