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, + ), )