From db88ee3e1d91baa934516ffadddf8dacb5c31f27 Mon Sep 17 00:00:00 2001 From: Marco Huymajer Date: Mon, 25 Mar 2013 09:44:07 +0100 Subject: [PATCH] Add a "check_modify_exclude mechanism" to move lines issue2768 review505004 --- move.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/move.py b/move.py index ed7cdefe63..3e9c651126 100644 --- a/move.py +++ b/move.py @@ -601,6 +601,7 @@ class Line(ModelSQL, ModelView): @classmethod def __setup__(cls): super(Line, cls).__setup__() + cls._check_modify_exclude = ['reconciliation'] cls._sql_constraints += [ ('credit_debit', 'CHECK(credit * debit = 0.0)', @@ -1273,7 +1274,7 @@ class Line(ModelSQL, ModelView): def write(cls, lines, vals): Move = Pool().get('account.move') - if len(vals) > 1 or 'reconciliation' not in vals: + if any(k not in cls._check_modify_exclude for k in vals): cls.check_modify(lines) moves = [x.move for x in lines] super(Line, cls).write(lines, vals)