Amit Dodiya (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.1-opw-579697-ado into 
lp:openobject-addons/6.1.

Requested reviews:
  Xavier ALT (OpenERP) (xal-openerp)
  Naresh(OpenERP) (nch-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-579697-ado/+merge/126679

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
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-579697-ado/+merge/126679
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.1-opw-579697-ado.
=== 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 @@
         cr.execute('update account_move_line set '+mode2+'=%s where id=%s', (result, line_id))
 
         #adjust also the amount in currency if needed
-        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,))
+        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,))
         for row in cr.dictfetchall():
             currency_id = currency_obj.browse(cr, uid, row['currency_id'], context=context)
             if not currency_obj.is_zero(cr, uid, currency_id, row['amount_currency']):

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to