From 132d4b80f3d5dad792468bd14961f6a9540122e2 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Wed, 15 Nov 2023 10:32:25 +0700 Subject: add new role for wms and fix bug delete reconcile --- indoteknik_custom/models/account_move.py | 5 +++-- indoteknik_custom/models/users.py | 2 ++ indoteknik_custom/views/users.xml | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'indoteknik_custom') diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index fe9db583..d55cca38 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -48,8 +48,9 @@ class AccountMove(models.Model): def unlink(self): res = super(AccountMove, self).unlink() - if self.state == 'posted': - raise UserError('Data Hanya Bisa Di Cancel') + for rec in self: + if rec.state == 'posted': + raise UserError('Data Hanya Bisa Di Cancel') return res def button_cancel(self): diff --git a/indoteknik_custom/models/users.py b/indoteknik_custom/models/users.py index 2ff9933e..d95b56e7 100644 --- a/indoteknik_custom/models/users.py +++ b/indoteknik_custom/models/users.py @@ -12,6 +12,8 @@ class Users(models.Model): is_logistic_approver = fields.Boolean(string='Logistic Approver', help='Berhak Approval Penerimaan Barang') is_editor_product = fields.Boolean(string='Editor Product', help='Berhak Mengedit Data Product') is_admin_reconcile = fields.Boolean(string='Admin Reconcile', help='Berhak Mengedit Journal Reconcile') + is_inbound = fields.Boolean(string='Operator Inbound') + is_outbound = fields.Boolean(string='Operator Outbound') def notify_internal_users(self, message, title): users = self.search([('share', '=', False)]) diff --git a/indoteknik_custom/views/users.xml b/indoteknik_custom/views/users.xml index 020d8ddc..6519aeaa 100644 --- a/indoteknik_custom/views/users.xml +++ b/indoteknik_custom/views/users.xml @@ -14,6 +14,8 @@ + + -- cgit v1.2.3