Bad price calculation (unit conversion) when product changes in invoice line

Bug #1035394 reported by Iván Antón (Ozono Multimedia)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Confirmed
Low
OpenERP Publisher's Warranty Team

Bug Description

Version: openobject-addons 6.1
Revision: 6940 (and earlier)
Module: account

When you are using different units than base ones, a bad price calculation is done when you change product in an invoice line.

Patch is attached.

Revision history for this message
Iván Antón (Ozono Multimedia) (ozono) wrote :
Revision history for this message
Ravish(OpenERP) (rmu-openerp) wrote :

Hello Ivan,

I have checked your issue with and without patch ,But for me it's working same way.
For your more reference ,I have attached videos .Please have a look.

If I missed some thing .correct me with more sufficient description.

Thanks for post..!!!

Revision history for this message
Ravish(OpenERP) (rmu-openerp) wrote :
Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Iván Antón (Ozono Multimedia) (ozono) wrote :

Hi Ravish, thanks for your answer.

The issue only affects to the on_change method.

First time you add one invoice line, you can't verify the bug: in that case, all works fine.

The problem comes, by example, when you add one line and, later, you re-link a product. Also the chosen product must be in different units than base ones (hours, by example).

I have loaded a clean database with demo data and I have made a video to describe it.

Patch explanation:

* When you convert from one unit to another from the same category first you need to convert to base unit (multiplying by origin unit 'factor') and then to destination unit (multiplying by dest unit 'factor_inv'): In original code only first multiplication is done. I only have put factor_inv in the equation.

* I also have added one condition (to the if) to avoid conversion when product unit is the same than line unit. The code will work without this but I think is more elegant this way.

Revision history for this message
Iván Antón (Ozono Multimedia) (ozono) wrote :
Revision history for this message
Ravish(OpenERP) (rmu-openerp) wrote :

Hello,

I have checked again ended with that, it's effecting only stable_6_1 GTK.
It's crucial issue .So I'm assigning it to OPW team.

Thanks..!!!

Changed in openobject-addons:
importance: Undecided → Low
status: Incomplete → Confirmed
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.