diff options
| -rw-r--r-- | indoteknik_custom/models/tukar_guling_po.py | 4 |
1 files 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!") |
