summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2026-02-27 09:53:40 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2026-02-27 09:53:40 +0700
commit687e462aaf3112d3b8a7dcecfc8c50582c531798 (patch)
treea524bf360355aea16f7e5b2b21650db229e1d6a3
parent49863418d3cf9aea12cd9594ef5351648664027c (diff)
<Miqdad> push
-rwxr-xr-xindoteknik_custom/models/sale_order.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index e6fc4732..d42aefcc 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -2601,12 +2601,22 @@ class SaleOrder(models.Model):
def check_archived_product(self):
for order in self:
for line in order.order_line:
- if line.product_id.active == False:
- raise UserError("Terdapat Product yang sudah di Archive pada Product: {}".format(line.product_id.display_name))
+ # Skip section & note
+ if line.display_type:
+ continue
+
+ if line.product_id and not line.product_id.active:
+ raise UserError(
+ "Terdapat Product yang sudah di Archive pada Product: {}".format(
+ line.product_id.display_name
+ )
+ )
def check_archived_uom(self):
for order in self:
for line in order.order_line:
+ if line.display_type:
+ continue
if line.product_uom.active == False:
raise UserError("Terdapat UoM yang sudah di Archive pada UoM {} di Product {}".format(line.product_uom.name, line.product_id.display_name))