summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-03-06 14:14:41 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-03-06 14:14:41 +0700
commit051704a89b5a5ab4d28ae4ccb7747c3de3714850 (patch)
treeb5635037e7068b68f7e0b3186e46d1772736e082
parent9bb6313ad7fdb119da8a91ced77dc5ff7aeafdf9 (diff)
enable only accounting can cancel account.move
-rw-r--r--indoteknik_custom/models/account_move.py10
1 files 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()