From 6df75c07332e216fd6251d95ffb1a09121d291d3 Mon Sep 17 00:00:00 2001 From: Jorge Pinna Puissant Date: Tue, 26 Jan 2021 08:31:08 +0000 Subject: [PATCH] [FIX] purchase: convert standard price depending on the uom - Install purchase and stock; - Activate Units of Measure (uom); - Create a new storable product; - Choose a different uom for: 'Unit of Measure' (e.g., Dozens) and 'Purchase Unit of Measure' (e.g., Units); - Update the Cost (e.g. $ 300.00 per Dozens) - Create a PO; - Add the product. Before this commit, the price on the PO will be 300 and the unit of measure will be 'Units'. Now, the price will be adapted to the 'Purchase Unit of Measure', in this example it will be $25.0 per Unit. opw-2439506 closes odoo/odoo#65119 X-original-commit: 27d251a17f3ccc597e2cd277b6d40a31dc9889b2 Signed-off-by: Jorge Pinna Puissant (jpp) --- addons/purchase/models/purchase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index 4953a083391..41f98fbea30 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -1077,7 +1077,7 @@ class PurchaseOrderLine(models.Model): # If not seller, use the standard price. It needs a proper currency conversion. if not seller: price_unit = self.env['account.tax']._fix_tax_included_price_company( - self.product_id.standard_price, + self.product_id.uom_id._compute_price(self.product_id.standard_price, self.product_id.uom_po_id), self.product_id.supplier_taxes_id, self.taxes_id, self.company_id,