From 91053600709246edf4e445b5c6f1ef438c172acb Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Fri, 9 Mar 2018 11:41:24 +0100 Subject: [PATCH] Manage template overriden field issue6912 review43911002 --- account.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/account.py b/account.py index 2f2ced45f0..cf6dcca4a2 100644 --- a/account.py +++ b/account.py @@ -5,7 +5,7 @@ from sql.aggregate import Max, Min, Sum from trytond.model import ModelSQL, ModelView, fields from trytond.pool import PoolMeta, Pool -from trytond.pyson import Eval +from trytond.pyson import Eval, Bool from trytond.transaction import Transaction @@ -25,7 +25,12 @@ class Tax: __metaclass__ = PoolMeta __name__ = 'account.tax' - ec_sales_list_code = fields.Char("EC Sales List Code") + ec_sales_list_code = fields.Char("EC Sales List Code", + states={ + 'readonly': (Bool(Eval('template', -1)) + & ~Eval('template_override', False)), + }, + depends=['template', 'template_override']) class ECSalesList(ModelSQL, ModelView):