[6.0] Picking validation has rounding errors with digital precisions

Bug #862449 reported by Marco Dieckhoff
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP Publisher's Warranty Team

Bug Description

Error messages in Picking validation use the %d formatter for error messages.
This surpresses digits and you may end up with rounded (down) values.

Look at the example picture with values <1
"Processing quantity 0 [tons] for [product] is larger than the available quantity 0 [tons]!"

Tags: maintenance

Related branches

Revision history for this message
Marco Dieckhoff (dieck) wrote :
Revision history for this message
Marco Dieckhoff (dieck) wrote :

Fixed these problems in lp:~dieck/openobject-addons/6.0-d_vs_f, using dp digital precisions and %s variables, to allow translations, without having one for every digital precision.

Found (only) one more occurence of this problem in point_of_sale.

Changed in openobject-addons:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: maintenance
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Rifakat Husen (OpenERP) (rha-openerp) wrote :

Hello Marco Dieckhoff,

We really appreciate your efforts and contribution towards community.

A much effective fix has been applied in this branch,
lp:~openerp-dev/openobject-addons/6.0-opw-17871-rha
Revision ID: <email address hidden>
Revision 4859

Can you please check it out whether it works for you or not?
Thank you very much for your good work!

Best regards.

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Marco Dieckhoff (dieck) wrote :

The solution in lp:~openerp-dev/openobject-addons/6.0-opw-17871-rha does not use the decimal precision, it simply uses %s instead of %d.

This way, you end up with the default python %s precision for floats of 6 decimals.

So, it would work for everyone who uses a decimal precision of 6 or less, but not for people who uses a decimal precision of 7 or above (though I doubt there are many of them).

But if you e.g. use only a precision of 2, you are presented with 6 decimals on these messages, which may be confusing for the basic user.

I encourage using the appropriate configurable decimal precision.

Revision history for this message
Marco Dieckhoff (dieck) wrote :

If my branch lp:~dieck/openobject-addons/6.0-d_vs_f is considered to be used, please note: the changes made to the .po files are incomplete in my branch and should be taken from rha.

Revision history for this message
Raphael Collet (OpenERP) (rco-openerp) wrote :

Dear Marco,

I had a careful look at your branch, and I appreciate your fix.
I second your argument regarding the decimal precision of numbers in those messages.

I will merge both your branch and Rifakat's, and add the missing translation terms.

Many thanks for your contribution,

Raphael Collet

Revision history for this message
Rifakat Husen (OpenERP) (rha-openerp) wrote :

Landed into stable,
r4865, Revision ID: <email address hidden>
r4864 Revision ID: <email address hidden>

Best regards.

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.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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