From 20a71569a5700ff55f62c170eb4709f59e5fca08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 6 Mar 2009 10:30:16 +0100 Subject: [PATCH] Make tax fields invisible if there is no company defined for issue844 --- party.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/party.py b/party.py index 4e86eb248b..65dd6bd781 100644 --- a/party.py +++ b/party.py @@ -25,12 +25,16 @@ class Party(OSV): relation='account.tax', string='VAT', domain="[('group.code', '=', 'vat'), ('company', '=', company), " \ "('parent', '=', False)]", - help='This tax will be used, instead of the default VAT.') + states={ + 'invisible': "not globals().get('company') or not bool(company)", + }, help='This tax will be used, instead of the default VAT.') supplier_vat = fields.Property(type='many2one', relation='account.tax', string='Supplier VAT', domain="[('group.code', '=', 'vat'), ('company', '=', company), " \ "('parent', '=', False)]", - help='This tax will be used, instead of the default VAT ' \ + states={ + 'invisible': "not globals().get('company') or not bool(company)", + }, help='This tax will be used, instead of the default VAT ' \ 'for supplier invoices.') receivable = fields.Function('get_receivable_payable', fnct_search='search_receivable_payable', string='Receivable')