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 | |
| parent | 38e9987c0dadfee86b3769a922c4025973b45861 (diff) | |
<Miqdad> fix approval
| -rw-r--r-- | fixco_custom/models/stock_inventory.py | 7 | ||||
| -rw-r--r-- | fixco_custom/views/stock_inventory.xml | 1 |
2 files changed, 3 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' 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 @@ <field name="arch" type="xml"> <xpath expr="//field[@name='date']" position="after"> <field name="number"/> + <field name="approval_state"/> </xpath> </field> </record> |
