Change default debit/credit on journal into property

Account are link to company but not the journals, so property will make the
glue.
This commit is contained in:
Cédric Krier committed 2008-03-27 16:54:54 +01:00
1 parent 0b1cb7e3c5
commit 1bbf0a1019
1 file changed
+12 -4
+12 -4
View File
@@ -79,10 +79,18 @@ class Journal(OSV):
update_posted = fields.Boolean('Allow cancelling moves')
sequence = fields.Many2One('ir.sequence', 'Sequence', required=True,
domain="[('code', '=', 'account.journal')]")
#XXX chance to properties to be multi-company
# must be required if centralised
credit_account = fields.Many2One('account.account', 'Default credit account')
debit_account = fields.Many2One('account.account', 'Default debit account')
credit_account = fields.Property('account.account', type='many2one',
relation='account.account', string='Default Credit Account',
domain="[('type', '!=', 'view'), ('company', '=', company)]",
states={
'required': "centralised",
})
debit_account = fields.Property('account.account', type='many2one',
relation='account.account', string='Default Debit Account',
domain="[('type', '!=', 'view'), ('company', '=', company)]",
states={
'required': "centralised",
})
def default_active(self, cursor, user, context=None):
return True