From 2def9515d57eb3128cad31c8b97901055e4e0523 Mon Sep 17 00:00:00 2001 From: Mqdd Date: Tue, 10 Feb 2026 15:42:21 +0700 Subject: fix approval flow stock inventory --- indoteknik_custom/models/stock_inventory.py | 13 +++++-------- indoteknik_custom/views/stock_inventory.xml | 1 + 2 files changed, 6 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") diff --git a/indoteknik_custom/views/stock_inventory.xml b/indoteknik_custom/views/stock_inventory.xml index df747830..89c058ea 100644 --- a/indoteknik_custom/views/stock_inventory.xml +++ b/indoteknik_custom/views/stock_inventory.xml @@ -26,6 +26,7 @@ + -- cgit v1.2.3 From 30ccd81fe087eec277da6875b1df9d9a3579ab77 Mon Sep 17 00:00:00 2001 From: FIN-IT_AndriFP Date: Tue, 10 Feb 2026 16:35:53 +0700 Subject: (andri) add report internal PO --- indoteknik_custom/__manifest__.py | 1 + .../report/purchase_report_internal.xml | 201 +++++++++++++++++++++ 2 files changed, 202 insertions(+) create mode 100644 indoteknik_custom/report/purchase_report_internal.xml diff --git a/indoteknik_custom/__manifest__.py b/indoteknik_custom/__manifest__.py index 66962a24..61eef35b 100755 --- a/indoteknik_custom/__manifest__.py +++ b/indoteknik_custom/__manifest__.py @@ -169,6 +169,7 @@ 'report/report_surat_piutang.xml', 'report/report_tutup_tempo.xml', 'report/purchase_report.xml', + 'report/purchase_report_internal.xml', 'views/vendor_sla.xml', 'views/coretax_faktur.xml', 'views/public_holiday.xml', diff --git a/indoteknik_custom/report/purchase_report_internal.xml b/indoteknik_custom/report/purchase_report_internal.xml new file mode 100644 index 00000000..09fb81f3 --- /dev/null +++ b/indoteknik_custom/report/purchase_report_internal.xml @@ -0,0 +1,201 @@ + + + + + + Purchase Order (Internal) + purchase.order + qweb-pdf + indoteknik_custom.report_purchaseorder_internal + indoteknik_custom.report_purchaseorder_internal + + ('%s - %s' % (object.name, object.partner_id.name)) + + + report + + + + + + + + + + + -- cgit v1.2.3 From 9879c06b35da5402d1df545c352bd2729722ca24 Mon Sep 17 00:00:00 2001 From: FIN-IT_AndriFP Date: Tue, 10 Feb 2026 16:38:26 +0700 Subject: foix --- indoteknik_custom/report/purchase_report_internal.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indoteknik_custom/report/purchase_report_internal.xml b/indoteknik_custom/report/purchase_report_internal.xml index 09fb81f3..7df847de 100644 --- a/indoteknik_custom/report/purchase_report_internal.xml +++ b/indoteknik_custom/report/purchase_report_internal.xml @@ -172,7 +172,7 @@ - Margin % + Margin PO % -- cgit v1.2.3