Merge lp:~openerp-dev/openobject-addons/6.1-opw-579697-ado into lp:openobject-addons/6.1

Proposed by Amit Dodiya (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-579697-ado
Merge into: lp:openobject-addons/6.1
Diff against target: 12 lines (+1/-1)
1 file modified
account/account.py (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-579697-ado
Reviewer Review Type Date Requested Status
Xavier ALT Pending
Naresh(OpenERP) Pending
Review via email: mp+126679@code.launchpad.net

Description of the change

Hello,

"[FIX] generate opening entries wizard gives error due to null value in amount_currency field"

When amount_currency field of account move line contains null value the wizard "Generate Opening Entry" will gives the following error.
TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'

Regards,
Amit Dodiya

To post a comment you must log in.

Unmerged revisions

7006. By Amit Dodiya<email address hidden>

[FIX] generate opening entries wizard gives error due to null value in amount_currency field

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account.py'
2--- account/account.py 2012-08-28 07:48:35 +0000
3+++ account/account.py 2012-09-27 13:01:31 +0000
4@@ -1519,7 +1519,7 @@
5 cr.execute('update account_move_line set '+mode2+'=%s where id=%s', (result, line_id))
6
7 #adjust also the amount in currency if needed
8- cr.execute("select currency_id, sum(amount_currency) as amount_currency from account_move_line where move_id = %s and currency_id is not null group by currency_id", (move.id,))
9+ cr.execute("select currency_id, COALESCE(sum(amount_currency), 0) as amount_currency from account_move_line where move_id = %s and currency_id is not null group by currency_id", (move.id,))
10 for row in cr.dictfetchall():
11 currency_id = currency_obj.browse(cr, uid, row['currency_id'], context=context)
12 if not currency_obj.is_zero(cr, uid, currency_id, row['amount_currency']):