← 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 :(

 

Hi,


Ok, may be I need to put more infos here to let you understand sorry. First, I will make it open again cause this is a real bug. Here are the infos:

- The referred object is 'price_type' from pricelist.py and is still
widely used if I don't miss something... At least in price lists, but
should also be used in the analytic accounting IMHO.

- No menu exists anymore for this object (price.type), I had to create
one.

- In invoices it is ok cause the invoice handle this for us, so no
problem here.

The problematic:

A price type define which float field of the product represent a price,
and in which currency this price is expressed. This is used into price
list and should convert the currency according to that infos (not the
company currency for example).

By default OpenERP set the same currency for company and price.type, so
with a standard config, not problem. But when you have a company in EUR
and prices expressed in USD, so the troubles starts !

Let make this:

- Company EUR
- Price type Standard price CHF
- Make one analytic line (from timesheet or by encoding it manualy) with a product where standard price = 40 (which is supposed to be CHF).

=> The result is an analytic line with amount = 40. This amount is in
EUR cause the company is in EUR and this is not the right value, I
expect to have 40 * Rate = ~30

This is also true in the stock accounting by the way ! And here you let
the code I had made some 5 month ago. So please, consider this
seriously.

The price.type must be taken into account everywhere or nowhere (so it
means, remove it !).

Thanks to have a closer look,

Regards,

Joël

** Changed in: openobject-addons
       Status: Invalid => New

** Changed in: openobject-addons
     Assignee: (unassigned) => OpenERP R&D Addons Team 3 (openerp-dev-addons3)

-- 
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