From 566a20db595a2b0a1959a12d289361b16e1ef172 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Fri, 3 Nov 2023 13:42:51 +0700 Subject: add approval in editing reconcile & journal entries --- indoteknik_custom/models/account_bank_statement.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 indoteknik_custom/models/account_bank_statement.py (limited to 'indoteknik_custom/models/account_bank_statement.py') diff --git a/indoteknik_custom/models/account_bank_statement.py b/indoteknik_custom/models/account_bank_statement.py new file mode 100644 index 00000000..495367e8 --- /dev/null +++ b/indoteknik_custom/models/account_bank_statement.py @@ -0,0 +1,19 @@ +from odoo import fields, models, api, _ +from odoo.exceptions import AccessError, UserError, ValidationError + +class AccountBankStatement(models.Model): + _inherit = "account.bank.statement" + + is_edit = fields.Boolean(string='Edit', default=False) + + def is_edited(self): + if not self.env.user.is_admin_reconcile: + raise UserError('Yang berhak hanya Mba Tania') + + self.is_edit = True + + def not_edited(self): + if not self.env.user.is_admin_reconcile: + raise UserError('Yang berhak hanya Mba Tania') + + self.is_edit = False \ No newline at end of file -- cgit v1.2.3 From d05d1f609441ff0ead57d447c0ece63a968410de Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Sat, 4 Nov 2023 09:19:07 +0700 Subject: invisible field edit on reconcile --- indoteknik_custom/models/account_bank_statement.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indoteknik_custom/models/account_bank_statement.py') diff --git a/indoteknik_custom/models/account_bank_statement.py b/indoteknik_custom/models/account_bank_statement.py index 495367e8..23008f13 100644 --- a/indoteknik_custom/models/account_bank_statement.py +++ b/indoteknik_custom/models/account_bank_statement.py @@ -4,16 +4,16 @@ from odoo.exceptions import AccessError, UserError, ValidationError class AccountBankStatement(models.Model): _inherit = "account.bank.statement" - is_edit = fields.Boolean(string='Edit', default=False) + is_edit = fields.Boolean(string='Unlock', default=False) def is_edited(self): if not self.env.user.is_admin_reconcile: - raise UserError('Yang berhak hanya Mba Tania') + raise UserError('Yang berhak hanya Mba Tania dan Iqmal Saputra') self.is_edit = True def not_edited(self): if not self.env.user.is_admin_reconcile: - raise UserError('Yang berhak hanya Mba Tania') + raise UserError('Yang berhak hanya Mba Tania dan Iqmal Saputra') self.is_edit = False \ No newline at end of file -- cgit v1.2.3