Invoice line subtotal rounding issue

Bug #977300 reported by Paulius Sladkevičius @ hbee
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Low
OpenERP R&D Addons Team 3
Therp Backports (Deprecated)
Status tracked in Addons-6.1
Addons-6.1
Fix Released
Undecided
Ronald Portier (Therp)

Bug Description

I have faced rounding issue with quantity 2.5 and price 4.83.

[RESULT OBSERVED]
2.5 x 4.83 = 12.07

[RESULT EXPECTED]
2.5 x 4.83 = 12.08

I found that issue came from the account compute_all() method http://bazaar.launchpad.net/~openerp/openobject-addons/trunk/view/head:/account/account.py#L2072. For currency OpenERP use float_round() function to "fix" rounding issue, but here python default round() function used and of course it don't round correctly.

And from here comes, why in the other accounting parts float_round() is not used instead round()?

Revision history for this message
Paulius Sladkevičius @ hbee (komsas) wrote :

Here is simple patch.

Revision history for this message
Ravish(OpenERP) (rmu-openerp) wrote :

Hello Paulius

I have checked your issue in both 6.1 stable and trunk .But for me ,it's working fine
Would you please provide more and sufficient steps to reproduce it.

Thanks!!

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Paulius Sladkevičius @ hbee (komsas) wrote :

Ravish,

check invoice screenshot and 3rd invoice line with description "test A" and you can see that subtotal is not correct. I have tested this on the v61 stable last revision.

Changed in openobject-addons:
status: Incomplete → New
Revision history for this message
Ravish(OpenERP) (rmu-openerp) wrote :

Hello,

I have checked further ,But ended with same result.
For your more reference ,I have attached screen-shot.Please have a look.

I have tested with following Revision Number

Server: 4140
client: 2300
Addons: 6734

Thanks!!

Revision history for this message
Ravish(OpenERP) (rmu-openerp) wrote :
Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Paulius Sladkevičius @ hbee (komsas) wrote :

Ravish,

I have pulled last revisions now and rounding still incorrect, please give me your python version and try on yours: python -c "print round(2.5*4.83,2)", what value you get? Its a bit strange why we get different result with same source.

I'm using rev:
Server: 4141
client: 2300
Addons: 6735

Changed in openobject-addons:
status: Incomplete → New
Revision history for this message
Paulius Sladkevičius @ hbee (komsas) wrote :

What I found out more about round and different python versions:
- Python 2.6.5, round(2.5*4.83,2) -> 12.08
- Python 2.7.2, round(2.5*4.83,2) -> 12.07

I found in the docs, that OpenERP support 2.6 and 2.7, so seems problem comes because Python versions act different.

Revision history for this message
Ravish(OpenERP) (rmu-openerp) wrote :

Hello,

As per different python versions ,I am conforming this issue.

Thanks!!

Changed in openobject-addons:
status: New → Incomplete
status: Incomplete → Confirmed
importance: Undecided → Low
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
Revision history for this message
Ravish(OpenERP) (rmu-openerp) wrote :

Hello,

It has been fixed on lp:~openerp-dev/openobject-addons/trunk-bug-977300-rmu branch with following Revision Number and Revision ID.

Revision Number:6770
Revision ID : <email address hidden>

This will merge soon with trunk

Thanks..!!!

Changed in openobject-addons:
status: Confirmed → Fix Committed
Revision history for this message
qdp (OpenERP) (qdp) wrote :

fix released in revision 7111

thanks for the contribution,
Quentin

Changed in openobject-addons:
status: Fix Committed → Fix Released
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.