From 6777edb758fb29981a0baac663b1388a820cded8 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Thu, 26 Oct 2023 15:54:47 +0700 Subject: bug fix get purchase price in sales order --- indoteknik_custom/models/sale_order_line.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indoteknik_custom/models/sale_order_line.py b/indoteknik_custom/models/sale_order_line.py index 748153ad..eda003c7 100644 --- a/indoteknik_custom/models/sale_order_line.py +++ b/indoteknik_custom/models/sale_order_line.py @@ -87,6 +87,10 @@ class SaleOrderLine(models.Model): p_price = purchase_price.product_price else: p_price = purchase_price.system_price + elif purchase_price.system_price > 0 and purchase_price.product_price == 0: + p_price = purchase_price.system_price + elif purchase_price.system_price == 0 and purchase_price.product_price > 0: + p_price = purchase_price.product_price return p_price @api.onchange('product_id') -- cgit v1.2.3