← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 704469] Re: Price.type currency isn't taken into computation #analytic #accounting : this is quite dangerous. Cost = 50EUR -> If company CHF => 50CHF :(

 

Just a little things more. I think just adding the currency (in context)
in which you want the result in the on_change_unit_amount of
analytic_line, should give the right result :

context['currency_id']=company_obj.browse(cr,uid,company_id).currency_id.id
amount_unit = prod.price_get(pricetype.field, context=ctx)[prod.id]

This trouble comes, as you said Quentin, cause you remove my code (with
full support of multi-currency / multi-comapny in analytic accounting).
But you let some parts... without lots of testing I think :(

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/704469

Title:
  Price.type currency isn't taken into computation #analytic #accounting
  : this is quite dangerous. Cost = 50EUR -> If company CHF => 50CHF :(

Status in OpenObject Addons Modules:
  New

Bug description:
  Hi,

  
  Given :

  - My company is in CHF
  - My price.type is in EUR
  - I record an analytic line with any product (ex: cost 30, which is supposed to be in EUR)

  I should have an Amount in the analytic line = 30 EUR * RATE ~= 45 CHF
  !!!

  This is quite important in multi-company context. Thanks to have a
  look.

  Little helps:

  In the on_change_unit_amount of analytic_line, you should give the
  currency in the context of price_get function:

  context['currency_id']=company_obj.browse(cr,uid,company_id).currency_id.id
  amount_unit = prod.price_get(pricetype.field, context=ctx)[prod.id]

  Regards,

  Joël





References