summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2023-10-26 15:54:47 +0700
committerstephanchrst <stephanchrst@gmail.com>2023-10-26 15:54:47 +0700
commit6777edb758fb29981a0baac663b1388a820cded8 (patch)
tree0099fecb65c2557880db9cbdabb6a13bfb97c994
parent0037ab8019daad5c1cfccd0007284c54b5c22253 (diff)
bug fix get purchase price in sales order
-rw-r--r--indoteknik_custom/models/sale_order_line.py4
1 files changed, 4 insertions, 0 deletions
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')