Use editable instead of of readonly for account template override

This commit is contained in:
Cédric Krier committed 2026-09-21 15:24:43 +02:00
1 parent a5b3061674
commit cbb762530b
10 files changed
+54 -52

No files matched your search

+7 -5
View File
@@ -2,7 +2,7 @@
# this repository contains the full copyright notices and license terms.
from trytond.model import fields
from trytond.pool import Pool, PoolMeta
from trytond.pyson import Bool, Eval
from trytond.pyson import Eval
class Tax(metaclass=PoolMeta):
@@ -66,8 +66,9 @@ class Tax(metaclass=PoolMeta):
('VAT', "Value added tax"),
], "UNECE Code",
states={
'readonly': (Bool(Eval('template', -1))
& ~Eval('template_override', False)),
'editable': (
~Eval('template', None)
| Eval('template_override', False)),
},
help="Standard code of "
"the United Nations Economic Commission for Europe.")
@@ -99,8 +100,9 @@ class Tax(metaclass=PoolMeta):
('Z', "Zero rated goods"),
], "UNECE Category Code",
states={
'readonly': (Bool(Eval('template', -1))
& ~Eval('template_override', False)),
'editable': (
~Eval('template', None)
| Eval('template_override', False)),
},
help="Standard code of "
"the United Nations Economic Commission for Europe.")