From 1910796be907efcbb38de4ba29848d5a0164d0a4 Mon Sep 17 00:00:00 2001 From: Elouan Le Bars Date: Thu, 24 Oct 2019 14:49:57 +0200 Subject: [PATCH] [FIX] beesdoo_product : wrong suggested prices for different buying/selling units Conversion to default unit was done without consideration for displayed unit. --- beesdoo_product/models/beesdoo_product.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/beesdoo_product/models/beesdoo_product.py b/beesdoo_product/models/beesdoo_product.py index d474740..eeb238d 100644 --- a/beesdoo_product/models/beesdoo_product.py +++ b/beesdoo_product/models/beesdoo_product.py @@ -139,7 +139,10 @@ class BeesdooProduct(models.Model): def _compute_cost(self): suppliers = self._get_main_supplier_info() if(len(suppliers) > 0): - self.suggested_price = (suppliers[0].price * self.uom_po_id.factor)* (1 + suppliers[0].product_tmpl_id.categ_id.profit_margin / 100) + # Conversion to displayed unit + ratio = self.uom_po_id.factor / self.uom_id.factor + margin = suppliers[0].product_tmpl_id.categ_id.profit_margin + self.suggested_price = (suppliers[0].price * ratio) * (1 + margin / 100) class BeesdooScaleCategory(models.Model): _name = "beesdoo.scale.category"