diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2025-02-13 12:34:21 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2025-02-13 12:34:21 +0700 |
| commit | dce36bb896e89a763b182924b0cfa9cec4f39735 (patch) | |
| tree | 3f901efb0402e0f65d91abd90b350847c4060c8d | |
| parent | 3474af21127db27f1b63ddb879e26da232e2e3d0 (diff) | |
fix bug
| -rw-r--r-- | indoteknik_custom/models/sale_order_line.py | 16 |
1 files 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( |
