From 1c22aac19722184599bff8ee628ba494d3d87906 Mon Sep 17 00:00:00 2001 From: Frederik Jaeckel Date: Wed, 21 Sep 2022 17:01:14 +0200 Subject: [PATCH] book: sichtbarkeit des 'beitrag und nummerierung'-reiters korrigiert --- book.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/book.py b/book.py index fde854d..a3704ed 100644 --- a/book.py +++ b/book.py @@ -28,6 +28,9 @@ STATES2 = { ), 'invisible': ~Bool(Eval('btype')), } +STATES3 = {} +STATES3.update(STATES2) +STATES3['required'] = ~STATES2['invisible'] DEPENDS2 = ['state', 'btype'] sel_state_book = [ @@ -83,10 +86,7 @@ class Book(tree(separator='/'), Workflow, ModelSQL, ModelView): ('company', '=', Eval('company', -1)), ], ], - states={ - 'readonly': STATES2['readonly'], - 'required': Bool(Eval('btype')), - }, depends=DEPENDS2+['company']) + states=STATES3, depends=DEPENDS2+['company']) number_atcheck = fields.Boolean(string="number when 'Checking'", help="The numbering of the lines is done in the step Check. If the check mark is inactive, this happens with Done.", states=STATES2, depends=DEPENDS2) @@ -97,7 +97,7 @@ class Book(tree(separator='/'), Workflow, ModelSQL, ModelView): Bool(Eval('lines')), ), 'invisible': STATES2['invisible'], - 'required': Bool(Eval('btype')), + 'required': ~STATES2['invisible'], }, depends=DEPENDS2+['lines']) balance = fields.Function(fields.Numeric(string='Balance', readonly=True, digits=(16, Eval('currency_digits', 2)), @@ -110,7 +110,7 @@ class Book(tree(separator='/'), Workflow, ModelSQL, ModelView): Bool(Eval('lines', [])), ), 'invisible': STATES2['invisible'], - 'required': Bool(Eval('btype')), + 'required': ~STATES2['invisible'], }, depends=DEPENDS2+['lines']) currency_digits = fields.Function(fields.Integer(string='Currency Digits', readonly=True), 'on_change_with_currency_digits')