summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-06-26 15:54:06 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-06-26 15:54:06 +0700
commit526c80302b26fc2d7a0ab362966bd55bef53d12f (patch)
treeb1920c963277e229905430f9fd68aaff23040838 /indoteknik_custom/models/purchase_order.py
parentde28ec85c504b10098abdf53cfebebef68aaf626 (diff)
parentc790750afd36ed86772477bce9307b16689910c4 (diff)
Merge branch 'production' of bitbucket.org:altafixco/indoteknik-addons into production
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