[FIX] account: Account Move Line creation error=> when there is no debit and credit value

lp bug: https://launchpad.net/bugs/570132 fixed

bzr revid: mra@tinyerp.com-20100427125847-jd7v6ptp0gfhv00s
This commit is contained in:
mra (Open ERP) 2010-04-27 18:28:47 +05:30
parent 00bf1f7d66
commit ff2277ac30
1 changed files with 2 additions and 2 deletions

View File

@ -922,9 +922,9 @@ class account_move_line(osv.osv):
vals['analytic_lines'] = [(0,0, {
'name': vals['name'],
'date': vals.get('date', time.strftime('%Y-%m-%d')),
'account_id': vals['analytic_account_id'],
'account_id': vals.get('analytic_account_id', False),
'unit_amount':'quantity' in vals and vals['quantity'] or 1.0,
'amount': vals['debit'] or vals['credit'],
'amount': vals.get('debit', False) or vals.get('credit', False) or 0.0,
'general_account_id': vals['account_id'],
'journal_id': journal.analytic_journal_id.id,
'ref': vals.get('ref', False),