From 990ba8fbb127faf2e9c32ec8428786c701dd12b3 Mon Sep 17 00:00:00 2001 From: Anh Vu Date: Thu, 4 Jan 2024 12:11:27 +0700 Subject: [PATCH] [FIX] use lst_price for _compute_margin in product.product --- product_standard_margin/__manifest__.py | 2 +- product_standard_margin/models/product_product.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/product_standard_margin/__manifest__.py b/product_standard_margin/__manifest__.py index 53e3d3da..0f84d181 100644 --- a/product_standard_margin/__manifest__.py +++ b/product_standard_margin/__manifest__.py @@ -5,7 +5,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Product Margin and Margin Rate", - "version": "16.0.1.0.1", + "version": "16.0.1.0.2", "author": "Camptocamp,GRAP,Odoo Community Association (OCA)", "category": "Product", "depends": ["account"], diff --git a/product_standard_margin/models/product_product.py b/product_standard_margin/models/product_product.py index 1ad77b30..a63e86a7 100644 --- a/product_standard_margin/models/product_product.py +++ b/product_standard_margin/models/product_product.py @@ -52,7 +52,7 @@ class ProductProduct(models.Model): # Compute Section @api.depends( - "list_price", + "lst_price", "product_tmpl_id.list_price", "standard_price", "taxes_id.price_include", @@ -62,7 +62,7 @@ class ProductProduct(models.Model): def _compute_margin(self): for product in self: product.list_price_vat_excl = product.taxes_id.compute_all( - product.list_price, product=product + product.lst_price, product=product )["total_excluded"] product.standard_margin = ( product.list_price_vat_excl - product.standard_price