Merge lp:~openerp-dev/openobject-addons/6.1-opw-575865-nep into lp:openobject-addons/6.1

Proposed by Nehal Panchal (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-575865-nep
Merge into: lp:openobject-addons/6.1
Diff against target: 21 lines (+3/-1)
1 file modified
account_voucher/account_voucher.py (+3/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-575865-nep
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+111360@code.launchpad.net

Description of the change

Hello,

Cannot pay foreign currency invoices with foreign currency vouchers.

This fixes the issue.

Thanks.

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

This bug was qualified as Already Fixed on Trunk (means that it was already fixed and merged in Trunk). If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,
Naresh Soni

Unmerged revisions

6855. By Nehal Panchal (OpenERP)

[FIX] account_voucher :Can't pay foreign currency invoices with foreign currency vouchers

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-30 11:07:16 +0000
3+++ account_voucher/account_voucher.py 2012-06-21 09:15:03 +0000
4@@ -1023,6 +1023,8 @@
5 currency_rate_difference = line.move_line_id.amount_residual - amount
6 else:
7 currency_rate_difference = 0.0
8+ if voucher_brw.type in ('purchase', 'payment'):
9+ currency_rate_difference = -1 * currency_rate_difference
10 move_line = {
11 'journal_id': voucher_brw.journal_id.id,
12 'period_id': voucher_brw.period_id.id,
13@@ -1081,7 +1083,7 @@
14 # otherwise we use the rates of the system (giving the voucher date in the context)
15 amount_currency = currency_obj.compute(cr, uid, company_currency, line.move_line_id.currency_id.id, move_line['debit']-move_line['credit'], context=ctx)
16 if line.amount == line.amount_unreconciled and line.move_line_id.currency_id.id == voucher_currency:
17- foreign_currency_diff = line.move_line_id.amount_residual_currency + amount_currency
18+ foreign_currency_diff = abs(line.move_line_id.amount_residual_currency) - abs(amount_currency)
19
20 move_line['amount_currency'] = amount_currency
21 voucher_line = move_line_obj.create(cr, uid, move_line)