diff options
| -rw-r--r-- | indoteknik_custom/models/manufacturing.py | 4 | ||||
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/indoteknik_custom/models/manufacturing.py b/indoteknik_custom/models/manufacturing.py index 2455a117..37c4e909 100644 --- a/indoteknik_custom/models/manufacturing.py +++ b/indoteknik_custom/models/manufacturing.py @@ -23,7 +23,9 @@ class Manufacturing(models.Model): def button_mark_done(self): if self._name != 'mrp.production': return super(Manufacturing, self).button_mark_done() - + # Check product category + if self.product_id.categ_id.name != 'Finish Good': + raise UserError('Tidak bisa di complete karna product category bukan Unit / Finish Good') for line in self.move_raw_ids: # if line.quantity_done > 0 and line.quantity_done != self.product_uom_qty: # raise UserError('Qty Consume per Line tidak sama dengan Qty to Produce') 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 |
