summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order.py
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
-rwxr-xr-xindoteknik_custom/models/purchase_order.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 836df945..db474895 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -438,6 +438,12 @@ class PurchaseOrder(models.Model):
for line in self.order_line:
if not line.product_id.purchase_ok:
raise UserError("Terdapat barang yang tidak bisa diproses")
+ # Validasi pajak
+ if not line.taxes_id:
+ raise UserError("Masukkan Tax untuk produk")
+ for tax in line.taxes_id:
+ if tax.type_tax_use != 'purchase':
+ raise UserError("Pastikan Tax Category nya adalah Purchase pada produk %s" % line.product_id.name)
if line.price_unit != line.price_vendor and line.price_vendor != 0:
self._send_po_not_sync()
send_email = True