Merge lp:~openerp-dev/openobject-addons/6.1-opw-590373-dhs into lp:openobject-addons/6.1

Proposed by Dhruti Shastri(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-590373-dhs
Merge into: lp:openobject-addons/6.1
Diff against target: 20 lines (+2/-1)
1 file modified
account_voucher/account_voucher.py (+2/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-590373-dhs
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+155939@code.launchpad.net

Description of the change

OpenERP v6.1 . Home currency is EUR.
Create USD bank account and did the following steps:

Input a customer payment USD 1,000 without reconcile with any sales
invoice. Validate this payment.
Then I got the following entries which have two positive 1,000 in Amount
Currency.

To post a comment you must log in.

Unmerged revisions

7195. By Dhruti Shastri(OpenERP)

[account_voucher] : Payment in foreign currency with no Sign (case: 590373)

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 2013-03-28 11:47:23 +0000
4@@ -1152,6 +1152,7 @@
5 account_id = voucher_brw.partner_id.property_account_receivable.id
6 else:
7 account_id = voucher_brw.partner_id.property_account_payable.id
8+ sign = voucher_brw.type == 'payment' and -1 or 1
9 move_line = {
10 'name': write_off_name or name,
11 'account_id': account_id,
12@@ -1160,7 +1161,7 @@
13 'date': voucher_brw.date,
14 'credit': diff > 0 and diff or 0.0,
15 'debit': diff < 0 and -diff or 0.0,
16- 'amount_currency': company_currency <> current_currency and voucher_brw.writeoff_amount or False,
17+ 'amount_currency': company_currency <> current_currency and (sign * -1 * voucher_brw.writeoff_amount) or False,
18 'currency_id': company_currency <> current_currency and current_currency or False,
19 'analytic_account_id': voucher_brw.analytic_id and voucher_brw.analytic_id.id or False,
20 }