diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-06-26 10:23:48 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-06-26 10:23:48 +0700 |
| commit | fcc629d93b0da863bcdab2fad0812deeee5da6b2 (patch) | |
| tree | 9dd8b3ffbd7ca681af0f02bf0222d98b08b3726b /indoteknik_custom/models/purchase_order.py | |
| parent | ac01fa257abf2f12588d240689c42f0d12da644f (diff) | |
<iman> add tax validation & product category
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 6 |
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 |
