diff options
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index 13ff2931..1eb76370 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -191,6 +191,9 @@ class PurchaseOrder(models.Model): raise UserError("Beda Margin dengan Sales, harus approval Manager") if not self.sale_order_id and not self.env.user.is_purchasing_manager and not self.env.user.is_leader: raise UserError("Tidak ada link dengan SO, harus approval Manager") + for line in self.order_line: + if not line.product_id.purchase_ok: + raise UserError("Terdapat barang yang tidak bisa di proses") self.approval_status = 'approved' self.po_status = 'menunggu' |
