From e354bf76e875491333e346ac8d28dd251a306e9d Mon Sep 17 00:00:00 2001 From: Quentin Groulard Date: Tue, 20 Feb 2024 12:02:48 +0100 Subject: [PATCH] [IMP] shopinvader_schema_sale: sale_line qty rounding --- shopinvader_schema_sale/schemas/sale_line.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shopinvader_schema_sale/schemas/sale_line.py b/shopinvader_schema_sale/schemas/sale_line.py index 86aeed2fed..12b65e823b 100644 --- a/shopinvader_schema_sale/schemas/sale_line.py +++ b/shopinvader_schema_sale/schemas/sale_line.py @@ -3,6 +3,8 @@ from extendable_pydantic import StrictExtendableBaseModel +from odoo.tools.float_utils import json_float_round + from .amount import SaleLineAmount @@ -20,5 +22,8 @@ def from_sale_order_line(cls, odoo_rec): product_id=odoo_rec.product_id.id, name=odoo_rec.name, amount=SaleLineAmount.from_sale_order_line(odoo_rec), - qty=odoo_rec.product_uom_qty, + qty=json_float_round( + odoo_rec.product_uom_qty, + precision_rounding=odoo_rec.product_uom.rounding, + ), )