Fix domain and depends on journal because company is not always in context

(transplanted from 5852812e3433f86f52c43a8bf0daa1abd721add7)
This commit is contained in:
Cédric Krier committed 2009-11-06 08:13:03 +01:00
1 parent 9936889d35
commit f5918a04b6
1 file changed
+6 -4
+6 -4
View File
@@ -90,20 +90,22 @@ class Journal(ModelSQL, ModelView):
context={'code': 'account.journal'})
credit_account = fields.Property(type='many2one',
relation='account.account', string='Default Credit Account',
domain="[('kind', '!=', 'view'), ('company', '=', company)]",
domain="[('kind', '!=', 'view'), " \
"('company', '=', context.get('company'))]",
states={
'required': "centralised or " \
"(type == 'cash' and context.get('company'))",
'invisible': "not context.get('company')",
}, depends=['company', 'type', 'centralised'])
}, depends=['type', 'centralised'])
debit_account = fields.Property(type='many2one',
relation='account.account', string='Default Debit Account',
domain="[('kind', '!=', 'view'), ('company', '=', company)]",
domain="[('kind', '!=', 'view'), " \
"('company', '=', context.get('company'))]",
states={
'required': "centralised or " \
"(type == 'cash' and context.get('company'))",
'invisible': "not context.get('company')",
}, depends=['company', 'type', 'centralised'])
}, depends=['type', 'centralised'])
def __init__(self):
super(Journal, self).__init__()