Make tax fields invisible if there is no company defined for issue844

This commit is contained in:
Cédric Krier committed 2009-03-06 10:30:16 +01:00
1 parent 61a2b65a51
commit 20a71569a5
1 file changed
+6 -2
+6 -2
View File
@@ -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')