← Back to team overview

openerp-india team mailing list archive

[Bug 1286585] [NEW] Conversion problem in res_currency.py

 

Public bug reported:

I have been trying to add product by using xml-rpc to OpenERP v7.

I am using;
- Multicurrency with TRL, USD, JPY and EUR
- Product Price Currency Module (product_price_currency)

When I try to add product it returns error below;
....
  File "/opt/openerp/server/openerp/addons/product_price_currency/product.py", line 99, in compute_list_price
    context=context)
  File "/opt/openerp/server/openerp/addons/base/res/res_currency.py", line 235, in compute
    return self.round(cr, uid, to_currency, from_amount * rate)

solution;

I have added float(...) to the line 232;
"return self.round(cr, uid, to_currency, from_amount * rate)"
to
"return self.round(cr, uid, to_currency, float(from_amount) * rate)"

This was a straight forward fix for this bug. I hope it helps.

Regards

** Affects: openobject-addons
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1286585

Title:
  Conversion problem in res_currency.py

Status in OpenERP Addons (modules):
  New

Bug description:
  I have been trying to add product by using xml-rpc to OpenERP v7.

  I am using;
  - Multicurrency with TRL, USD, JPY and EUR
  - Product Price Currency Module (product_price_currency)

  When I try to add product it returns error below;
  ....
    File "/opt/openerp/server/openerp/addons/product_price_currency/product.py", line 99, in compute_list_price
      context=context)
    File "/opt/openerp/server/openerp/addons/base/res/res_currency.py", line 235, in compute
      return self.round(cr, uid, to_currency, from_amount * rate)

  solution;

  I have added float(...) to the line 232;
  "return self.round(cr, uid, to_currency, from_amount * rate)"
  to
  "return self.round(cr, uid, to_currency, float(from_amount) * rate)"

  This was a straight forward fix for this bug. I hope it helps.

  Regards

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1286585/+subscriptions


Follow ups

References