From 5b0b7a4de90d5c48a52006b3a12ef8a98f0b68aa Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Sat, 4 Mar 2023 09:05:07 +0700 Subject: cant delete or cancel if not accounting --- indoteknik_custom/models/account_move.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 18dbfba7..5ac691ac 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -14,6 +14,18 @@ class AccountMove(models.Model): date_terima_tukar_faktur = fields.Date(string='Terima Faktur') shipper_faktur_id = fields.Many2one('delivery.carrier', string='Shipper Faktur') + def unlink(self): + res = super(AccountMove, self).unlink() + if not self.env.user.is_accounting: + raise UserError('Hanya Accounting yang bisa delete') + return res + + def button_cancel(self): + res = super(AccountMove, self).button_cancel() + if not self.env.user.is_accounting: + raise UserError('Hanya Accounting yang bisa Cancel') + return res + def button_draft(self): res = super(AccountMove, self).button_draft() if not self.env.user.is_accounting: -- cgit v1.2.3 From 9bb6313ad7fdb119da8a91ced77dc5ff7aeafdf9 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Mon, 6 Mar 2023 13:56:26 +0700 Subject: disable restrict only accounting can cancel --- indoteknik_custom/models/account_move.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 5ac691ac..c8f9c288 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -20,11 +20,11 @@ class AccountMove(models.Model): raise UserError('Hanya Accounting yang bisa delete') return res - def button_cancel(self): - res = super(AccountMove, self).button_cancel() - if not self.env.user.is_accounting: - raise UserError('Hanya Accounting yang bisa Cancel') - return res + # def button_cancel(self): + # res = super(AccountMove, self).button_cancel() + # if not self.env.user.is_accounting: + # raise UserError('Hanya Accounting yang bisa Cancel') + # return res def button_draft(self): res = super(AccountMove, self).button_draft() -- cgit v1.2.3 From 051704a89b5a5ab4d28ae4ccb7747c3de3714850 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Mon, 6 Mar 2023 14:14:41 +0700 Subject: enable only accounting can cancel account.move --- indoteknik_custom/models/account_move.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index c8f9c288..db4886f4 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -20,11 +20,11 @@ class AccountMove(models.Model): raise UserError('Hanya Accounting yang bisa delete') return res - # def button_cancel(self): - # res = super(AccountMove, self).button_cancel() - # if not self.env.user.is_accounting: - # raise UserError('Hanya Accounting yang bisa Cancel') - # return res + def button_cancel(self): + res = super(AccountMove, self).button_cancel() + if self.id and not self.env.user.is_accounting: + raise UserError('Hanya Accounting yang bisa Cancel') + return res def button_draft(self): res = super(AccountMove, self).button_draft() -- cgit v1.2.3 From a72a4c2d96eefdfc265373916588d2e89dcb9e53 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Thu, 9 Mar 2023 14:44:13 +0700 Subject: change from approval accounting to finance --- indoteknik_custom/models/stock_picking.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 1dba31a3..5bf774f4 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -53,7 +53,7 @@ class StockPicking(models.Model): ], string='Approval Status', readonly=True, copy=False, index=True, tracking=3, help="Approval Status untuk Internal Use") approval_return_status = fields.Selection([ - ('pengajuan1', 'Approval Accounting'), + ('pengajuan1', 'Approval Finance'), ('approved', 'Approved'), ], string='Approval Return Status', readonly=True, copy=False, index=True, tracking=3, help="Approval Status untuk Return") date_doc_kirim = fields.Datetime(string='Tanggal Kirim di SJ', help="Tanggal Kirim di cetakan SJ, tidak berpengaruh ke Accounting") -- cgit v1.2.3