Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] product: price list reports with too many fractional digits #36705

Conversation

jpp-odoo
Copy link
Contributor

Before this commit, when printing the Price List report of a Product
Variant, the price is printed directly from the float result of the
calculation of the price, even if this price is rounded, the
representation of the float can have, sometimes, float precision errors
(a lot of 0 after the decimal point, and a 1 or 2 at the end).

Now, the function returns a string formatted to the correct number of
fractional digits.

opw-2069305

Copy link
Contributor

@nim-odoo nim-odoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not really a good idea to change the return type of such a method... Maybe create _get_price_repr and call it in the report?

@nim-odoo
Copy link
Contributor

@robodoo robodoo added the CI 🤖 Robodoo has seen passing statuses label Sep 11, 2019
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Sep 11, 2019
Before this commit, when printing the Price List report of a Product
Variant, the price is printed directly from the float result of the
calculation of the price, even if this price is rounded, the
representation of the float can have, sometimes, float precision errors
(a lot of 0 after the decimal point, and a 1 or 2 at the end).

Now, the function returns a string formatted to the correct number of
fractional digits.

opw-2069305
@jpp-odoo jpp-odoo force-pushed the 12.0-opw-2069305-float_pricelist_printing-jpp branch from 2e9421e to 6403767 Compare September 12, 2019 08:07
@robodoo robodoo removed the CI 🤖 Robodoo has seen passing statuses label Sep 12, 2019
@jpp-odoo
Copy link
Contributor Author

@nim-odoo I just made the changes we talk about.

Copy link
Contributor

@nim-odoo nim-odoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

robodoo r+

@robodoo robodoo added r+ 👌 CI 🤖 Robodoo has seen passing statuses labels Sep 12, 2019
@robodoo robodoo closed this in 4ae4c55 Sep 12, 2019
@robodoo
Copy link
Contributor

robodoo commented Sep 12, 2019

Merged at 4ae4c55, thanks!

@jpp-odoo jpp-odoo deleted the 12.0-opw-2069305-float_pricelist_printing-jpp branch September 12, 2019 10:53
nim-odoo pushed a commit to odoo-dev/odoo that referenced this pull request Sep 12, 2019
Before this commit, when printing the Price List report of a Product
Variant, the price is printed directly from the float result of the
calculation of the price, even if this price is rounded, the
representation of the float can have, sometimes, float precision errors
(a lot of 0 after the decimal point, and a 1 or 2 at the end).

Now, the function returns a string formatted to the correct number of
fractional digits.

opw-2069305

closes odoo#36705

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
robodoo pushed a commit that referenced this pull request Sep 12, 2019
Before this commit, when printing the Price List report of a Product
Variant, the price is printed directly from the float result of the
calculation of the price, even if this price is rounded, the
representation of the float can have, sometimes, float precision errors
(a lot of 0 after the decimal point, and a 1 or 2 at the end).

Now, the function returns a string formatted to the correct number of
fractional digits.

opw-2069305

closes #36705

closes #36770

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
@nim-odoo
Copy link
Contributor

@jpp-odoo maybe to backport in v11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI 🤖 Robodoo has seen passing statuses OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants