summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom/models')
-rw-r--r--indoteknik_custom/models/mrp_production.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/indoteknik_custom/models/mrp_production.py b/indoteknik_custom/models/mrp_production.py
index 8179fe56..58c2512c 100644
--- a/indoteknik_custom/models/mrp_production.py
+++ b/indoteknik_custom/models/mrp_production.py
@@ -244,6 +244,10 @@ class CheckBomProduct(models.Model):
@api.constrains('production_id', 'product_id')
def _check_product_bom_validation(self):
for record in self:
+ if record.production_id.sale_order.state not in ['sale', 'done']:
+ raise UserError((
+ "SO harus diconfirm terlebih dahulu."
+ ))
if not record.production_id or not record.product_id:
continue