Use globals() also in domain for issue1386

This commit is contained in:
Cédric Krier committed 2010-02-12 10:46:38 +01:00
1 parent 468a47801b
commit 0a30006b75
1 file changed
+6 -4
+6 -4
View File
@@ -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.')