summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2025-10-27 10:53:00 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2025-10-27 10:53:00 +0700
commit8952e591e6673b5e198f94a8e20598765a5b616a (patch)
tree0fa653e681b2396c6ffccef8ce30b2b01e045022
parent7f24bdb9a5902a6b7e28aa1703ced7cf316da33e (diff)
validation product category null
-rwxr-xr-xindoteknik_custom/models/purchase_order.py2
1 files changed, 2 insertions, 0 deletions
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