Merge lp:~openerp-dev/openobject-addons/6.0-opw-573404-nep into lp:openobject-addons/6.0

Proposed by Nehal Panchal (OpenERP)
Status: Approved
Approved by: Vinay Rana (OpenERP)
Approved revision: 5185
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-573404-nep
Merge into: lp:openobject-addons/6.0
Diff against target: 27 lines (+5/-3)
1 file modified
account_voucher/account_voucher.py (+5/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-573404-nep
Reviewer Review Type Date Requested Status
Thomas Winteler (Win-Soft) (community) Approve
Leonardo Pistone (community) Approve
Vinay Rana (OpenERP) (community) Approve
Naresh(OpenERP) Pending
Review via email: mp+101086@code.launchpad.net

Description of the change

Hello,

If we create Invoice with total 0.00, and make payment with amount 0.00. The state remains open.

This fixes the issue.

Thanks

To post a comment you must log in.
Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) :
review: Approve
Revision history for this message
Leonardo Pistone (lepistone) :
review: Approve
Revision history for this message
Thomas Winteler (Win-Soft) (thomi) :
review: Approve

Unmerged revisions

5185. By Nehal Panchal (OpenERP)

[FIX] account_voucher : Allow to close payment voucher with 0.00 amount

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_voucher/account_voucher.py'
2--- account_voucher/account_voucher.py 2012-03-20 07:20:19 +0000
3+++ account_voucher/account_voucher.py 2012-04-06 10:34:20 +0000
4@@ -736,10 +736,11 @@
5 for line in inv.line_ids:
6 #create one move line per voucher line where amount is not 0.0
7 if not line.amount:
8- continue
9+ if line.amount != line_total:
10+ continue
11 #we check if the voucher line is fully paid or not and create a move line to balance the payment and initial invoice if needed
12 if line.amount == line.amount_unreconciled:
13- amount = line.move_line_id.amount_residual #residual amount in company currency
14+ amount = line.move_line_id.amount_residual or 0.0#residual amount in company currency
15 else:
16 amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.untax_amount or line.amount, context=context_multi_currency)
17 move_line = {
18@@ -757,7 +758,8 @@
19 'date': inv.date
20 }
21 if not amount:
22- raise osv.except_osv(_('Warning'),
23+ if amount != line.amount:
24+ raise osv.except_osv(_('Warning'),
25 _("Error while processing 'account.voucher %s' (id:%s) for partner '%s', amount: %s !") % (inv.name, inv.id, inv.partner_id.name, inv.amount))
26 if amount < 0:
27 amount = -amount