diff options
| author | Miqdad <ahmadmiqdad27@gmail.com> | 2025-10-06 13:59:19 +0700 |
|---|---|---|
| committer | Miqdad <ahmadmiqdad27@gmail.com> | 2025-10-06 13:59:19 +0700 |
| commit | 8fe189d8f4caeed4b1aff764abc005b4e4ab3979 (patch) | |
| tree | da71d69bc810143d6c7fb4ffab0810675040eec7 | |
| parent | 4603578f08af74760c323aac624ea2ae95252d4b (diff) | |
<Miqdad> change button name and fix wrong validation
| -rw-r--r-- | indoteknik_custom/models/stock_picking.py | 8 | ||||
| -rw-r--r-- | indoteknik_custom/views/stock_picking.xml | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 8408cdc4..be0d77ac 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -1338,11 +1338,11 @@ class StockPicking(models.Model): if self.picking_type_id.code == 'incoming' and self.group_id.id == False and self.is_internal_use == False: raise UserError(_('Tidak bisa Validate jika tidak dari Document SO / PO')) - if self.is_internal_use and not self.env.user.is_logistic_approver and self.location_id.id == 57 and self.approval_status == 'pengajuan2': - raise UserError("Harus di Approve oleh Logistik") + # if self.is_internal_use and not self.env.user.is_logistic_approver and self.location_id.id == 57 and self.approval_status == 'pengajuan2': + # raise UserError("Harus di Approve oleh Logistik") - if self.is_internal_use and not self.env.user.is_accounting and self.approval_status == 'pengajuan1' and self.location_id.id == 57: - raise UserError("Harus di Approve oleh Accounting") + if self.is_internal_use and not self.env.user.is_logistic_approver and self.approval_status in ['pengajuan1', 'pengajuan2'] and self.location_id.id == 57: + raise UserError("Harus di Approve oleh Logistik") if self.picking_type_id.id == 28 and not self.env.user.is_logistic_approver: raise UserError("Harus di Approve oleh Logistik") diff --git a/indoteknik_custom/views/stock_picking.xml b/indoteknik_custom/views/stock_picking.xml index 7f0865f4..d943f27a 100644 --- a/indoteknik_custom/views/stock_picking.xml +++ b/indoteknik_custom/views/stock_picking.xml @@ -49,7 +49,7 @@ <xpath expr="//header" position="inside"> <button name="action_bu_iu_to_pengajuan2" type="object" - string="Set Ke Approval Logistik" + string="Approve by Accounting" class="btn-primary" attrs="{'invisible': [('is_bu_iu', '=', False), ('approval_status', 'in', ['pengajuan2', False, 'false', ''])]}"/> </xpath> |
