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
=== modified file 'account_voucher/account_voucher.py'
--- account_voucher/account_voucher.py 2012-12-05 17:57:01 +0000
+++ account_voucher/account_voucher.py 2012-12-20 07:27:14 +0000
@@ -1196,6 +1196,7 @@
1196 context = {}1196 context = {}
1197 move_pool = self.pool.get('account.move')1197 move_pool = self.pool.get('account.move')
1198 move_line_pool = self.pool.get('account.move.line')1198 move_line_pool = self.pool.get('account.move.line')
1199 line_pool = self.pool.get('account.voucher.line')
1199 for voucher in self.browse(cr, uid, ids, context=context):1200 for voucher in self.browse(cr, uid, ids, context=context):
1200 if voucher.move_id:1201 if voucher.move_id:
1201 continue1202 continue
@@ -1219,6 +1220,11 @@
1219 line_total = line_total - self._convert_amount(cr, uid, voucher.tax_amount, voucher.id, context=ctx)1220 line_total = line_total - self._convert_amount(cr, uid, voucher.tax_amount, voucher.id, context=ctx)
1220 elif voucher.type == 'purchase':1221 elif voucher.type == 'purchase':
1221 line_total = line_total + self._convert_amount(cr, uid, voucher.tax_amount, voucher.id, context=ctx)1222 line_total = line_total + self._convert_amount(cr, uid, voucher.tax_amount, voucher.id, context=ctx)
1223 # Check if any voucher_line is exist with amount 0.0 while validating voucher according to bug:1085223
1224 line_ids = ids and line_pool.search(cr, uid, [('voucher_id','=',voucher.id),('amount','=',0.0)])
1225 if line_ids:
1226 line_pool.unlink(cr,uid, line_ids)
1227
1222 # Create one move line per voucher line where amount is not 0.01228 # Create one move line per voucher line where amount is not 0.0
1223 line_total, rec_list_ids = self.voucher_move_line_create(cr, uid, voucher.id, line_total, move_id, company_currency, current_currency, context)1229 line_total, rec_list_ids = self.voucher_move_line_create(cr, uid, voucher.id, line_total, move_id, company_currency, current_currency, context)
12241230