From 3c984344d925d41c43cb9780f44051732b85e01f Mon Sep 17 00:00:00 2001 From: Benoit Socias Date: Wed, 20 Jul 2022 07:35:48 +0000 Subject: [PATCH] [IMP] rdtraining: update float utils information The warning about float utils does not state where to find them, and they are preceded by an example in the code that infringes the warning's recommendation. This commit indicates where to find the float utils and replaces the example by one that uses them. task-2925402 closes odoo/documentation#2508 X-original-commit: b8ee134a288b71bde695109787d18e1b6d7c464b Signed-off-by: Antoine Vandevenne (anv) --- content/developer/howtos/rdtraining/11_constraints.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/content/developer/howtos/rdtraining/11_constraints.rst b/content/developer/howtos/rdtraining/11_constraints.rst index cabb3a172..bfcd8e8bd 100644 --- a/content/developer/howtos/rdtraining/11_constraints.rst +++ b/content/developer/howtos/rdtraining/11_constraints.rst @@ -101,7 +101,7 @@ raise an exception if its invariant is not satisfied:: # all records passed the test, don't return anything A simple example can be found -`here `__. +`here `__. .. exercise:: Add Python constraints. @@ -113,7 +113,8 @@ A simple example can be found .. warning:: Always use the :meth:`~odoo.tools.float_utils.float_compare` and - :meth:`~odoo.tools.float_utils.float_is_zero` methods when working with floats! + :meth:`~odoo.tools.float_utils.float_is_zero` methods from `odoo.tools.float_utils` when + working with floats! Ensure the constraint is triggered every time the selling price or the expected price is changed!