From dce36bb896e89a763b182924b0cfa9cec4f39735 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Thu, 13 Feb 2025 12:34:21 +0700 Subject: fix bug --- indoteknik_custom/models/sale_order_line.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/indoteknik_custom/models/sale_order_line.py b/indoteknik_custom/models/sale_order_line.py index abf10f42..af521c2c 100644 --- a/indoteknik_custom/models/sale_order_line.py +++ b/indoteknik_custom/models/sale_order_line.py @@ -202,19 +202,19 @@ class SaleOrderLine(models.Model): # self.price_unit = selling_price # self.tax_id = tax_id - def _get_purchase_price(self, product_id): + def _get_purchase_price(self, product_id, manual=False): purchase_price = self.env['purchase.pricelist'].search( - [('product_id', '=', product_id.id), - # ('is_winner', '=', True) - ], - limit=1) + [('product_id', '=', product_id.id)], + limit=1 + ) vendor_id = purchase_price.brand_id.override_vendor_id if vendor_id: - return self._get_purchase_price_by_vendor(product_id, vendor_id) - - return self._get_valid_purchase_price(purchase_price) + return self._get_purchase_price_by_vendor(product_id, vendor_id, manual) + + return self._get_valid_purchase_price(purchase_price, manual) + def _get_purchase_price_by_vendor(self, product_id, vendor_id, manual=False): purchase_price = self.env['purchase.pricelist'].search( -- cgit v1.2.3