diff options
| author | Mqdd <ahmadmiqdad27@gmail.com> | 2026-02-10 15:39:56 +0700 |
|---|---|---|
| committer | Mqdd <ahmadmiqdad27@gmail.com> | 2026-02-10 15:39:56 +0700 |
| commit | a951e16565c11c137d06672ab8750cb3a246dd41 (patch) | |
| tree | 7cab0910a0fea71f75ff2212a34e91319cbb4e2d /fixco_custom/models | |
| parent | 38e9987c0dadfee86b3769a922c4025973b45861 (diff) | |
<Miqdad> fix approval
Diffstat (limited to 'fixco_custom/models')
| -rw-r--r-- | fixco_custom/models/stock_inventory.py | 7 |
1 files changed, 2 insertions, 5 deletions
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' |
