Merge lp:~openerp-dev/openobject-addons/6.1-opw-576606-han into lp:openobject-addons/6.1

Proposed by Hardik Ansodariya (OpenERP)
Status: Approved
Approved by: Vinay Rana (OpenERP)
Approved revision: 6882
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-576606-han
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-576606-han
Reviewer Review Type Date Requested Status
Vinay Rana (OpenERP) (community) Approve
Naresh(OpenERP) Pending
Review via email: mp+115314@code.launchpad.net

Description of the change

Hello,

Fix the issue;
When pass a value as None It was throwing error below
unsupported operand type(s) for /: 'NoneType' and 'float'

Steps to reproduce:

 * menu "Accounting / Periodical Processing / End of Period / Generate Opening Entries"
 * fields:
   - Fiscal Year to close: 2012
   - New Fiscal Year: 2013
   - Opening Entries Journal: Opening Entries Journal (EUR)
   - Opening Entries Period: Opening Period 2013
 * button: create

To post a comment you must log in.
Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) wrote :

The Propose patch will fix the issue.

review: Approve
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

This bug is not reproducible on Trunk so if this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,
Naresh Soni

Unmerged revisions

6882. By Hardik Ansodariya (OpenERP)

[FIX] account: set coalesce(sum(amount_currency), 0.0) as it was throwing a error when none value passed (Maintanece Case: 576606)

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-07-04 16:33:07 +0000
3+++ account/account.py 2012-07-17 11:03:21 +0000
4@@ -1517,7 +1517,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.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']):