Add a "check_modify_exclude mechanism" to move lines
issue2768 review505004
This commit is contained in:
1 parent
70725d834b
commit
db88ee3e1d
1 file changed
+2
-1
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user