summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/manufacturing.py
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2025-05-14 09:23:14 +0700
committerit-fixcomart <it@fixcomart.co.id>2025-05-14 09:23:14 +0700
commitf120c760c6a837681ebed26d9eea33a8961cd1aa (patch)
tree728ecdd5ffd1530d97d58a9f18b850186b39aa67 /indoteknik_custom/models/manufacturing.py
parenta571531bd8626f9bee25e89c62bbd9268ed30597 (diff)
parent2469ee37cfe854f0419a8c3fbabed5bc32bcaa6e (diff)
Merge branch 'odoo-backup' into CR/form-merchant
# Conflicts: # indoteknik_custom/models/__init__.py # indoteknik_custom/security/ir.model.access.csv
Diffstat (limited to 'indoteknik_custom/models/manufacturing.py')
-rw-r--r--indoteknik_custom/models/manufacturing.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/indoteknik_custom/models/manufacturing.py b/indoteknik_custom/models/manufacturing.py
index 24a8b8c3..715d8513 100644
--- a/indoteknik_custom/models/manufacturing.py
+++ b/indoteknik_custom/models/manufacturing.py
@@ -26,6 +26,13 @@ class Manufacturing(models.Model):
# 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')
+
+ if self.sale_order and self.sale_order.state != 'sale':
+ raise UserError(
+ ('Tidak bisa Mark as Done.\nSales Order "%s" (Nomor: %s) belum dikonfirmasi.')
+ % (self.sale_order.partner_id.name, self.sale_order.name)
+ )
+
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')