From 23a8749e8632d2583fffe6a2af0c0d9fd00ea84c Mon Sep 17 00:00:00 2001 From: Juan Ignacio Carreras Date: Tue, 16 Jun 2026 16:40:18 +0000 Subject: [PATCH] [FIX] product_replenishment_cost: skip currency convert when same currency in compute _compute_price_unit_and_date_planned_and_name was calling _convert() unconditionally, which applies currency rounding even for same-currency pairs. For supplier prices below currency precision (e.g. 0.0046 USD rounded to 2 decimals = 0.00), this caused price_unit to compute as 0 on manually added PO lines. _prepare_purchase_order_line already guards with if supplier.currency_id != po.currency_id Apply the same guard in the compute method. --- product_replenishment_cost/__manifest__.py | 2 +- product_replenishment_cost/models/purchase_order_line.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/product_replenishment_cost/__manifest__.py b/product_replenishment_cost/__manifest__.py index 5178b8fae..d39a22fbe 100644 --- a/product_replenishment_cost/__manifest__.py +++ b/product_replenishment_cost/__manifest__.py @@ -1,6 +1,6 @@ { "name": "Replenishment Cost", - "version": "18.0.1.1.0", + "version": "18.0.1.2.0", "author": "ADHOC SA, Odoo Community Association (OCA)", "license": "AGPL-3", "category": "Products", diff --git a/product_replenishment_cost/models/purchase_order_line.py b/product_replenishment_cost/models/purchase_order_line.py index dbae521eb..4ce6c1362 100644 --- a/product_replenishment_cost/models/purchase_order_line.py +++ b/product_replenishment_cost/models/purchase_order_line.py @@ -33,9 +33,10 @@ def _compute_price_unit_and_date_planned_and_name(self): if seller else 0.0 ) - price_unit = seller.currency_id._convert( - price_unit, line.currency_id, line.company_id, line.date_order or fields.Date.today() - ) + if seller.currency_id and line.currency_id and seller.currency_id != line.currency_id: + price_unit = seller.currency_id._convert( + price_unit, line.currency_id, line.company_id, line.date_order or fields.Date.today() + ) if seller and line.product_uom and seller.product_uom != line.product_uom: price_unit = seller.product_uom._compute_price(price_unit, line.product_uom)