From c7c058bcffef14b7fc08ee459d4198f1dd89dfc2 Mon Sep 17 00:00:00 2001 From: Miqdad Date: Wed, 23 Jul 2025 13:16:47 +0700 Subject: fix state vcm --- indoteknik_custom/models/tukar_guling_po.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indoteknik_custom/models/tukar_guling_po.py b/indoteknik_custom/models/tukar_guling_po.py index d2390854..6a349a09 100644 --- a/indoteknik_custom/models/tukar_guling_po.py +++ b/indoteknik_custom/models/tukar_guling_po.py @@ -43,8 +43,8 @@ class TukarGulingPO(models.Model): state = fields.Selection([ ('draft', 'Draft'), ('approval_purchase', 'Approval Purchasing'), - ('approval_logistic', 'Approval Logistic'), ('approval_finance', 'Approval Finance'), + ('approval_logistic', 'Approval Logistic'), ('done', 'Done'), ('cancel', 'Cancel'), ], string='Status', default='draft') @@ -214,7 +214,7 @@ class TukarGulingPO(models.Model): def _check_product_lines(self): """Constraint: Product lines harus ada jika state bukan draft""" for record in self: - if record.state in ('approval_purchase', 'approval_logistic', 'approval_finance', + if record.state in ('approval_purchase', 'approval_finance', 'approval_logistic', 'done') and not record.line_ids: raise ValidationError("Product lines harus diisi sebelum submit atau approve!") -- cgit v1.2.3