From b972e53c1a1b184123327b18ef89517e3c075ad6 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Mon, 22 Jan 2024 11:36:03 +0700 Subject: Fix _get_valid_purchase_price in sale order line --- indoteknik_custom/models/sale_order_line.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/indoteknik_custom/models/sale_order_line.py b/indoteknik_custom/models/sale_order_line.py index ab20fb09..78944876 100644 --- a/indoteknik_custom/models/sale_order_line.py +++ b/indoteknik_custom/models/sale_order_line.py @@ -96,10 +96,12 @@ class SaleOrderLine(models.Model): price = purchase_price.system_price or purchase_price.product_price or 0 if purchase_price.system_price > 0 and purchase_price.product_price > 0: - if purchase_price.human_last_update == False or purchase_price.system_last_update > purchase_price.human_last_update: + if not purchase_price.human_last_update or not purchase_price.system_last_update: + return price + + if purchase_price.system_last_update > purchase_price.human_last_update: price = purchase_price.system_price - - if purchase_price.system_last_update == False or purchase_price.human_last_update > purchase_price.system_last_update: + else: price = purchase_price.product_price return price -- cgit v1.2.3