Merge lp:~openerp-dev/openobject-addons/6.1-bug-1085223-dhs into lp:openobject-addons/6.1

Proposed by Dhruti Shastri(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-bug-1085223-dhs
Merge into: lp:openobject-addons/6.1
Diff against target: 22 lines (+6/-0)
1 file modified
account_voucher/account_voucher.py (+6/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-bug-1085223-dhs
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+140828@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

7108. By Dhruti Shastri(OpenERP)

[FIX][account_voucher]:Error to cancel payment of partner

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-12-05 17:57:01 +0000
3+++ account_voucher/account_voucher.py 2012-12-20 07:27:14 +0000
4@@ -1196,6 +1196,7 @@
5 context = {}
6 move_pool = self.pool.get('account.move')
7 move_line_pool = self.pool.get('account.move.line')
8+ line_pool = self.pool.get('account.voucher.line')
9 for voucher in self.browse(cr, uid, ids, context=context):
10 if voucher.move_id:
11 continue
12@@ -1219,6 +1220,11 @@
13 line_total = line_total - self._convert_amount(cr, uid, voucher.tax_amount, voucher.id, context=ctx)
14 elif voucher.type == 'purchase':
15 line_total = line_total + self._convert_amount(cr, uid, voucher.tax_amount, voucher.id, context=ctx)
16+ # Check if any voucher_line is exist with amount 0.0 while validating voucher according to bug:1085223
17+ line_ids = ids and line_pool.search(cr, uid, [('voucher_id','=',voucher.id),('amount','=',0.0)])
18+ if line_ids:
19+ line_pool.unlink(cr,uid, line_ids)
20+
21 # Create one move line per voucher line where amount is not 0.0
22 line_total, rec_list_ids = self.voucher_move_line_create(cr, uid, voucher.id, line_total, move_id, company_currency, current_currency, context)
23