diff options
Diffstat (limited to 'fixco_custom/models/stock_inventory.py')
| -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' |
