From 41da8b32edee0dc394bb69ac179833388e977053 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Mon, 13 Jan 2025 15:34:13 +0700 Subject: if unlock PO harus approv finance & if not FAT cannot edit jurnal entris --- indoteknik_custom/models/account_move.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indoteknik_custom/models/account_move.py') diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 725b3c2d..022a7f5f 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -318,6 +318,11 @@ class AccountMove(models.Model): if rec.statement_line_id and not rec.statement_line_id.statement_id.is_edit and rec.statement_line_id.statement_id.state == 'confirm': raise UserError('Bank Statement di Lock, Minta admin reconcile untuk unlock') + def write(self, vals): + if not self.env.user.is_accounting: + raise UserError("Hanya IT FAT yang bisa ubah data") + return super(AccountMove, self).write(vals) + # def write(self, vals): # res = super(AccountMove, self).write(vals) # for rec in self.line_ids: -- cgit v1.2.3 From ecc4356b7ac5ae14d4e86039589716fa76161230 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Mon, 13 Jan 2025 15:59:21 +0700 Subject: ubah code --- indoteknik_custom/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indoteknik_custom/models/account_move.py') diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 58f142dc..e681d96e 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -320,7 +320,7 @@ class AccountMove(models.Model): def write(self, vals): if not self.env.user.is_accounting: - raise UserError("Hanya IT FAT yang bisa ubah data") + raise UserError("Hanya Finence yang bisa ubah data") return super(AccountMove, self).write(vals) # def write(self, vals): -- cgit v1.2.3