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

Proposed by Luis Torres - http://www.vauxoo.com
Status: Merged
Merged at revision: 1079
Proposed branch: lp:~vauxoo/addons-vauxoo/7.0-amount_residual_payslip-dev_luis
Merge into: lp:addons-vauxoo/7.0
Diff against target: 24 lines (+2/-7)
1 file modified
payroll_amount_residual/hr_payslip.py (+2/-7)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/7.0-amount_residual_payslip-dev_luis
Reviewer Review Type Date Requested Status
Julio Serna-http://www.vauxoo.com Pending
Review via email: mp+226848@code.launchpad.net

Description of the change

Se quitó la funcionalidad de multicurrency en el calculo del monto restante

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'payroll_amount_residual/hr_payslip.py'
--- payroll_amount_residual/hr_payslip.py 2014-06-04 00:04:34 +0000
+++ payroll_amount_residual/hr_payslip.py 2014-07-15 14:35:13 +0000
@@ -35,19 +35,14 @@
35 context = {}35 context = {}
36 ctx = context.copy()36 ctx = context.copy()
37 result = {}37 result = {}
38 currency_obj = self.pool.get('res.currency')
39 for payslip in self.browse(cr, uid, ids, context=context):38 for payslip in self.browse(cr, uid, ids, context=context):
40 nb_inv_in_partial_rec = max_invoice_id = 039 nb_inv_in_partial_rec = max_invoice_id = 0
41 result[payslip.id] = 0.040 result[payslip.id] = 0.0
42 if payslip.move_id:41 if payslip.move_id:
43 for aml in payslip.move_id.line_id:42 for aml in payslip.move_id.line_id:
44 if aml.account_id.type in ('receivable','payable'):43 if aml.account_id.type in ('receivable','payable'):
45 if aml.currency_id and aml.currency_id.id == payslip.currency_id.id:44 result[payslip.id] += aml.amount_residual_currency
46 result[payslip.id] += aml.amount_residual_currency45 #prevent the residual amount on the payslip to be less than 0
47 else:
48 ctx['date'] = aml.date
49 result[payslip.id] += currency_obj.compute(cr, uid, aml.company_id.currency_id.id, payslip.currency_id.id, aml.amount_residual, context=ctx)
50 #prevent the residual amount on the invoice to be less than 0
51 result[payslip.id] = max(result[payslip.id], 0.0) 46 result[payslip.id] = max(result[payslip.id], 0.0)
52 return result47 return result
53 48