From 002edc557f51ddfef2aa983571fa55c7aab33a4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 13 Jul 2020 21:19:44 +0200 Subject: [PATCH] Make group invisible on tax template with parent This copies the behavior of tax. issue9444 review325661002 --- tax.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tax.py b/tax.py index 812b50f0f6..4e6fe7b9b2 100644 --- a/tax.py +++ b/tax.py @@ -475,7 +475,12 @@ class TaxTemplate(sequence_ordered(), ModelSQL, ModelView, DeactivableMixin): __name__ = 'account.tax.template' name = fields.Char('Name', required=True) description = fields.Char('Description', required=True) - group = fields.Many2One('account.tax.group', 'Group') + group = fields.Many2One( + 'account.tax.group', 'Group', + states={ + 'invisible': Bool(Eval('parent')), + }, + depends=['parent']) start_date = fields.Date('Starting Date') end_date = fields.Date('Ending Date') amount = fields.Numeric('Amount', digits=(16, 8),