From d70d65c19dccb2cc4264385c121c697ecd3fa8cd Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Wed, 14 May 2025 17:03:55 +0700 Subject: add validation state so on mrp production --- indoteknik_custom/models/mrp_production.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indoteknik_custom/models') 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 -- cgit v1.2.3