From d0dea0efca3f1f829de3a0a4c920744add9939a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 9 Jan 2023 00:37:15 +0100 Subject: [PATCH] Rename check_fifo_quantity_out constraint to check_fifo_quantity Closes #1781 --- modules/product_cost_fifo/move.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/product_cost_fifo/move.py b/modules/product_cost_fifo/move.py index 056c72d1ce..13d49f5d6c 100644 --- a/modules/product_cost_fifo/move.py +++ b/modules/product_cost_fifo/move.py @@ -29,11 +29,20 @@ class Move(metaclass=PoolMeta): t = cls.__table__() cls._sql_constraints += [ - ('check_fifo_quantity_out', + ('check_fifo_quantity', Check(t, t.quantity >= t.fifo_quantity), 'product_cost_fifo.msg_move_fifo_quantity_greater'), ] + @classmethod + def __register__(cls, module): + table_h = cls.__table_handler__(module) + super().__register__(module) + + # Migration from 6.6: rename check_fifo_quantity_out to + # check_fifo_quantity + table_h.drop_constraint('check_fifo_quantity_out') + @staticmethod def default_fifo_quantity(): return 0.0