Merge lp:~vauxoo/addons-vauxoo/7.0-amount_debit_credit_tax_inv_refounds-dev_luis into lp:addons-vauxoo/7.0

Proposed by Luis Torres - http://www.vauxoo.com
Status: Merged
Merged at revision: 982
Proposed branch: lp:~vauxoo/addons-vauxoo/7.0-amount_debit_credit_tax_inv_refounds-dev_luis
Merge into: lp:addons-vauxoo/7.0
Diff against target: 22 lines (+4/-1)
1 file modified
account_voucher_tax/account_voucher.py (+4/-1)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/7.0-amount_debit_credit_tax_inv_refounds-dev_luis
Reviewer Review Type Date Requested Status
Julio Serna-http://www.vauxoo.com Pending
Review via email: mp+204133@code.launchpad.net

Description of the change

Se agrego validacion que cuando el pago sea de una nota de credito invierta los montos en el debit y credit de los impuestos

To post a comment you must log in.
961. By Luis Torres - http://www.vauxoo.com

[IMP][account_voucher_tax]Change parameter of function by param in context

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_voucher_tax/account_voucher.py'
2--- account_voucher_tax/account_voucher.py 2013-11-14 20:26:01 +0000
3+++ account_voucher_tax/account_voucher.py 2014-02-11 21:18:31 +0000
4@@ -100,6 +100,7 @@
5 current_currency = self._get_current_currency(cr, uid, voucher_id, context)
6 move_ids=[]
7 for voucher in self.browse(cr, uid, [voucher_id], context=context):
8+ context.update({'amount_voucher': voucher.amount or 0.0})
9 for line in voucher.line_ids:
10 if line.tax_line_ids:
11 if line.amount > line.amount_original:
12@@ -361,7 +362,9 @@
13 'date' : date,
14 'tax_voucher_id' : tax_id,
15 }
16-
17+ if context.get('amount_voucher') and context.get('amount_voucher') < 0:
18+ debit_line_vals.update({'credit': debit_line_vals.get('debit', 0.0), 'debit': 0.0})
19+ credit_line_vals.update({'debit': credit_line_vals.get('credit', 0.0), 'credit': 0.0})
20 if type in ('payment','purchase'):
21 reference_amount < 0 and\
22 [credit_line_vals.pop('analytic_account_id'),