From 687e462aaf3112d3b8a7dcecfc8c50582c531798 Mon Sep 17 00:00:00 2001 From: Mqdd Date: Fri, 27 Feb 2026 09:53:40 +0700 Subject: push --- indoteknik_custom/models/sale_order.py | 14 ++++++++++++-- 1 file 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)) -- cgit v1.2.3