From ec5928b8e3b9864a4bb99d80dd92908cac7fa7d6 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 (transplanted from 6f12c2cea522b370829810a91f7b90e58467dc7e) --- party.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/party.py b/party.py index aa653c084d..79ee95b8e4 100644 --- a/party.py +++ b/party.py @@ -9,28 +9,32 @@ class Party(OSV): _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)", }) vat = fields.Property(type='many2one', relation='account.tax', string='VAT', - domain="[('group.code', '=', 'vat'), ('company', '=', company), " \ + domain="[('group.code', '=', 'vat'), " \ + "('company', '=', globals().get('company', 0)), " \ "('parent', '=', False)]", 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), " \ + domain="[('group.code', '=', 'vat'), " \ + "('company', '=', globals().get('company', 0)), " \ "('parent', '=', False)]", states={ 'invisible': "not globals().get('company') or not bool(company)",