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 993f09e1bc
commit 32ae68d087
1 file changed
+4 -2
+4 -2
View File
@@ -85,7 +85,8 @@ class Journal(OSV):
domain="[('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'))",
@@ -93,7 +94,8 @@ class Journal(OSV):
})
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'))",