From 1ecc747bca9b31606e29b92598cd6eab9f84b2f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 11 Dec 2008 20:23:06 +0100 Subject: [PATCH] Fix state test with company --- party.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/party.py b/party.py index 0dc04557c2..4e86eb248b 100644 --- a/party.py +++ b/party.py @@ -11,15 +11,15 @@ class Party(OSV): relation='account.account', string='Account Payable', domain="[('kind', '=', 'payable'), ('company', '=', company)]", states={ - 'required': "bool(company)", - 'invisible': "not bool(company)", + '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)]", states={ - 'required': "bool(company)", - 'invisible': "not bool(company)", + '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',