Files
odoo_source/addons
Levi Siuzdak (sile)andVictor Feyens 62081e5ec9 [FIX] {{website_,}sale_,}loyalty: format display points
Steps
-----
1. Create a loyalty card program awarding 1 point per $ spent;
2. make sure "Show points Unit" is enabled;
3. give yourself a loyalty card with 267.39 points on it;
4. create a product with a price of $0.89;
5. go to website and add it to your shopping car;
6. go to checkout.

Issue
-----
> You have 268.28000000000003 Loyalty point(s)

Cause
-----
The number comes from the `_get_real_points_for_coupon` method, which
uses `float_round` by way of `res.currency`.
The `float_round` function isn't suited for raw number display, as it
can make tiny rounding errors due to floating point arithmetic.

Solution
--------
Add a `_format_points` method to `loyalty.card` which will return a
string using the same format the `points_display` field uses.

opw-3705546

closes odoo/odoo#155652

X-original-commit: 767405a6fe8cea0407632acb57aae8bf25d8c001
Signed-off-by: Levi Siuzdak <sile@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: Victor Feyens <vfe@odoo.com>
2024-02-29 14:07:46 +00:00
..
2024-01-26 09:13:04 +00:00
2024-02-22 09:06:12 +00:00
2024-02-08 15:07:55 +00:00
2024-01-26 09:13:03 +00:00
2024-02-28 19:49:06 +00:00