changeset bd763f692212 in modules/account_statement:default
details:
https://hg.tryton.org/modules/account_statement?cmd=changeset&node=bd763f692212
description:
Do not use depends to prevent duplicate states from mixin fields
issue11134
diffstat:
statement.py | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diffs (20 lines):
diff -r d44fa6c38b54 -r bd763f692212 statement.py
--- a/statement.py Fri Apr 08 19:07:12 2022 +0200
+++ b/statement.py Sat Apr 09 00:04:13 2022 +0200
@@ -773,11 +773,11 @@
@classmethod
def __setup__(cls):
super(Line, cls).__setup__()
- if 'origin' not in cls.date.depends:
- cls.date.states.update({
- 'readonly': (cls.date.states['readonly']
- | Bool(Eval('origin', 0))),
- })
+ cls.date.states = {
+ 'readonly': (
+ (Eval('statement_state') != 'draft')
+ | Bool(Eval('origin', 0))),
+ }
cls.account.required = True
t = cls.__table__()
cls._sql_constraints += [