From 8952e591e6673b5e198f94a8e20598765a5b616a Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Mon, 27 Oct 2025 10:53:00 +0700 Subject: validation product category null --- indoteknik_custom/models/purchase_order.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index e79417aa..5a28c485 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -1123,6 +1123,8 @@ class PurchaseOrder(models.Model): if not self.not_update_purchasepricelist: self.add_product_to_pricelist() for line in self.order_line: + if not line.product_id.public_categ_ids: + raise UserError("Product %s kategorinya kosong" % line.product_id.name) if not line.product_id.purchase_ok: raise UserError("Terdapat barang yang tidak bisa diproses") # Validasi pajak -- cgit v1.2.3