[6.1] [account_voucher] exchange rate calculation is not working if company currency isn't rate 1
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Committed
|
Low
|
OpenERP Publisher's Warranty Team |
Bug Description
In the account_voucher module, the currency rate is not well calculated. The method that write the account move line is not correct. It starts at line 227 in account_voucher.py:
def _paid_amount_
if not ids: return {}
res = {}
rate = 1.0
for voucher in self.browse(cr, uid, ids, context=context):
if voucher.
if voucher.
return res
This should be (diff output):
for voucher in self.browse(cr, uid, ids, context=context):
if voucher.
if voucher.
- rate = 1 / voucher.
+ rate = voucher.
- rate = voucher_rate * company_
- res[voucher.id] = voucher.amount / rate
+ rate = company_
+ res[voucher.id] = voucher.amount * rate
return res
I am posting a merge proposal with this change in a couple of minutes.
There is also a wrong currency_amount value calculation even if you apply the previous patch. This wrong calculation apply to only some lines of the move. I will get back on this bug about this later.
Related branches
- Carlos Vásquez (ClearCorp) (community): Needs Resubmitting
- OpenERP Core Team: Pending requested
-
Diff: 103 lines (+25/-8)2 files modifiedaccount/test/account_supplier_invoice.yml (+0/-1)
account_voucher/account_voucher.py (+25/-7)
- Naresh(OpenERP): Pending requested
-
Diff: 31 lines (+5/-4)1 file modifiedaccount_voucher/account_voucher.py (+5/-4)
summary: |
- [6.1] [account_voucher} exchange rate calculation is not working if + [6.1] [account_voucher] exchange rate calculation is not working if company currency isn't rate 1 |
tags: | added: maintenance |
Changed in openobject-addons: | |
assignee: | nobody → OpenERP Publisher's Warranty Team (openerp-opw) |
importance: | Undecided → Low |
importance: | Low → Undecided |
Changed in openobject-addons: | |
status: | Fix Committed → Fix Released |
To complete the bug description, we are using the last 6.1 openobject-addons branch, to test this error, just make a new database with demo data, install account_voucher, without any account plan. Set the company to any currency other than EUR (so it won't be rate 1) and to an invoice in another third currency and try to do a payment with any currency, the debit and credit amount will be wrong calculated.