From 0a30006b75b15d300961bd83ada8111a1bdfd8d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 12 Feb 2010 10:46:38 +0100 Subject: [PATCH] Use globals() also in domain for issue1386 --- party.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/party.py b/party.py index fcdd9ee691..faeb509235 100644 --- a/party.py +++ b/party.py @@ -8,27 +8,29 @@ class Party(ModelSQL, ModelView): _name = 'party.party' account_payable = fields.Property(type='many2one', relation='account.account', string='Account Payable', - domain=[('kind', '=', 'payable'), "('company', '=', company)"], + domain=[('kind', '=', 'payable'), + "('company', '=', globals().get('company', 0))"], states={ 'required': "globals().get('company') and bool(company)", 'invisible': "not globals().get('company') or not bool(company)", }) account_receivable = fields.Property(type='many2one', relation='account.account', string='Account Receivable', - domain=[('kind', '=', 'receivable'), "('company', '=', company)"], + domain=[('kind', '=', 'receivable'), + "('company', '=', globals().get('company', 0))"], states={ 'required': "globals().get('company') and bool(company)", 'invisible': "not globals().get('company') or not bool(company)", }) customer_tax_rule = fields.Property(type='many2one', relation='account.tax.rule', string='Customer Tax Rule', - domain=["('company', '=', company)"], + domain=["('company', '=', globals().get('company', 0))"], states={ 'invisible': "not globals().get('company') or not bool(company)", }, help='Apply this rule on taxes when party is customer.') supplier_tax_rule = fields.Property(type='many2one', relation='account.tax.rule', string='Supplier Tax Rule', - domain=["('company', '=', company)"], + domain=["('company', '=', globals().get('company', 0))"], states={ 'invisible': "not globals().get('company') or not bool(company)", }, help='Apply this rule on taxes when party is supplier.')