diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2025-05-14 17:03:55 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2025-05-14 17:03:55 +0700 |
| commit | d70d65c19dccb2cc4264385c121c697ecd3fa8cd (patch) | |
| tree | fbe5ea2a3384b3763539b1fac6270efb0a6d571c /indoteknik_custom | |
| parent | 41a69ecfe8513a608c5a0accfb253ba6fb06f60a (diff) | |
add validation state so on mrp production
Diffstat (limited to 'indoteknik_custom')
| -rw-r--r-- | indoteknik_custom/models/mrp_production.py | 4 |
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 |
