From a951e16565c11c137d06672ab8750cb3a246dd41 Mon Sep 17 00:00:00 2001 From: Mqdd Date: Tue, 10 Feb 2026 15:39:56 +0700 Subject: fix approval --- fixco_custom/models/stock_inventory.py | 7 ++----- fixco_custom/views/stock_inventory.xml | 1 + 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'fixco_custom') diff --git a/fixco_custom/models/stock_inventory.py b/fixco_custom/models/stock_inventory.py index 96ac045..529aa66 100644 --- a/fixco_custom/models/stock_inventory.py +++ b/fixco_custom/models/stock_inventory.py @@ -17,11 +17,10 @@ class StockInventory(models.Model): ('out', 'Adjusment Out'), ], string='Adjusments Type', required=True) approval_state = fields.Selection([ - ('draft', 'Draft'), ('logistic', 'Logistic'), ('accounting', 'Accounting'), ('approved', 'Approved'), - ], default='draft', tracking=True) + ], default='logistic', tracking=True) def _generate_number_stock_inventory(self): """Men-generate nomor untuk semua stock inventory yang belum memiliki number.""" @@ -82,9 +81,7 @@ class StockInventory(models.Model): def action_approve(self): if self.adjusment_type == 'out': for rec in self: - if self.approval_state in [False, '', 'draft']: - self.approval_state = 'logistic' - elif self.approval_state == 'logistic': + if self.approval_state == 'logistic': if not rec.env.user.id in [10, 14, 20, 21]: raise UserError("Harus diapprove logistic") self.approval_state = 'accounting' diff --git a/fixco_custom/views/stock_inventory.xml b/fixco_custom/views/stock_inventory.xml index df74783..89c058e 100644 --- a/fixco_custom/views/stock_inventory.xml +++ b/fixco_custom/views/stock_inventory.xml @@ -26,6 +26,7 @@ + -- cgit v1.2.3