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
=== modified file 'account/account.py'
--- account/account.py 2012-08-28 07:48:35 +0000
+++ account/account.py 2012-09-27 13:01:31 +0000
@@ -1519,7 +1519,7 @@
1519 cr.execute('update account_move_line set '+mode2+'=%s where id=%s', (result, line_id))1519 cr.execute('update account_move_line set '+mode2+'=%s where id=%s', (result, line_id))
15201520
1521 #adjust also the amount in currency if needed1521 #adjust also the amount in currency if needed
1522 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,))1522 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,))
1523 for row in cr.dictfetchall():1523 for row in cr.dictfetchall():
1524 currency_id = currency_obj.browse(cr, uid, row['currency_id'], context=context)1524 currency_id = currency_obj.browse(cr, uid, row['currency_id'], context=context)
1525 if not currency_obj.is_zero(cr, uid, currency_id, row['amount_currency']):1525 if not currency_obj.is_zero(cr, uid, currency_id, row['amount_currency']):