diff options
| author | Mqdd <ahmadmiqdad27@gmail.com> | 2026-02-10 18:26:07 +0700 |
|---|---|---|
| committer | Mqdd <ahmadmiqdad27@gmail.com> | 2026-02-10 18:26:07 +0700 |
| commit | 16f8bd52164e8a0d205a0ffad69d0e3d8aa9e82c (patch) | |
| tree | 3470289e0e97cb98278660da6ed72f98d5bfa396 /indoteknik_custom/models | |
| parent | 7aadac577c7bdacf1fab54c23fe50b04fba08393 (diff) | |
| parent | 9879c06b35da5402d1df545c352bd2729722ca24 (diff) | |
Merge branch 'odoo-backup' of bitbucket.org:altafixco/indoteknik-addons into gudang-service
merge
Diffstat (limited to 'indoteknik_custom/models')
| -rw-r--r-- | indoteknik_custom/models/stock_inventory.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/indoteknik_custom/models/stock_inventory.py b/indoteknik_custom/models/stock_inventory.py index c4ebaeda..cb7d3773 100644 --- a/indoteknik_custom/models/stock_inventory.py +++ b/indoteknik_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,16 +81,14 @@ 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 rec.approval_state == 'logistic': if not rec.env.user.has_group('indoteknik_custom.group_role_logistic'): raise UserError("Harus diapprove logistic") - self.approval_state = 'accounting' - elif self.approval_state == 'accounting': + rec.approval_state = 'accounting' + elif rec.approval_state == 'accounting': if not rec.env.user.has_group('indoteknik_custom.group_role_fat'): raise UserError("Harus diapprove accounting") - self.approval_state = 'approved' + rec.approval_state = 'approved' else: raise UserError("Sudah Approved") |
