From fcc629d93b0da863bcdab2fad0812deeee5da6b2 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Wed, 26 Jun 2024 10:23:48 +0700 Subject: add tax validation & product category --- indoteknik_custom/models/manufacturing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indoteknik_custom/models/manufacturing.py') 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') -- cgit v1.2.3