diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2025-10-27 10:53:00 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2025-10-27 10:53:00 +0700 |
| commit | 8952e591e6673b5e198f94a8e20598765a5b616a (patch) | |
| tree | 0fa653e681b2396c6ffccef8ce30b2b01e045022 | |
| parent | 7f24bdb9a5902a6b7e28aa1703ced7cf316da33e (diff) | |
validation product category null
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 2 |
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 |
