Ravi Gohil (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.1-opw-572921-rgo into 
lp:openobject-addons/6.1.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)
Related bugs:
  Bug #954155 in OpenERP Addons: "[6.1] Voucher in currency compute twice the 
x-rate"
  https://bugs.launchpad.net/openobject-addons/+bug/954155

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-572921-rgo/+merge/98813

Hello,

> When using a voucher with a financial journal in foreign currency, once 
> validated, the journal entries generated is wrong because the exchange rate 
> is use twice.

This branch fixes this issue, kindly review it.

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-572921-rgo/+merge/98813
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.1-opw-572921-rgo.
=== modified file 'account_voucher/account_voucher.py'
--- account_voucher/account_voucher.py	2012-02-16 13:03:36 +0000
+++ account_voucher/account_voucher.py	2012-03-22 10:43:19 +0000
@@ -237,7 +237,7 @@
                     company_currency_rate =  voucher.payment_rate
                 else:
                     company_currency_rate = voucher.company_id.currency_id.rate
-            res[voucher.id] =  voucher.amount / voucher_rate * company_currency_rate
+            res[voucher.id] =  voucher.amount * company_currency_rate
         return res
 
     _name = 'account.voucher'
@@ -480,7 +480,7 @@
                 company_rate = rate
             else:
                 company_rate = self.pool.get('res.company').browse(cr, uid, company_id, context=context).currency_id.rate
-            res['value']['paid_amount_in_company_currency'] = amount / voucher_rate * company_rate
+            res['value']['paid_amount_in_company_currency'] = amount * company_rate
         return res
 
     def onchange_amount(self, cr, uid, ids, amount, rate, partner_id, journal_id, currency_id, ttype, date, payment_rate_currency_id, company_id, context=None):

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to