diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2023-11-03 13:42:51 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2023-11-03 13:42:51 +0700 |
| commit | 566a20db595a2b0a1959a12d289361b16e1ef172 (patch) | |
| tree | 1cc955d3392241639a025b5860be246650f201c5 /indoteknik_custom/models/account_move.py | |
| parent | 3a8d2713d749ce40d3755d4e0b22898ace4b0d6d (diff) | |
add approval in editing reconcile & journal entries
Diffstat (limited to 'indoteknik_custom/models/account_move.py')
| -rw-r--r-- | indoteknik_custom/models/account_move.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index a85e8caa..c55e2e1b 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -62,6 +62,10 @@ class AccountMove(models.Model): res = super(AccountMove, self).button_draft() if not self.env.user.is_accounting: raise UserError('Hanya Accounting yang bisa Reset to Draft') + + if self.write_date != self.create_date: + if self.statement_line_id and not self.statement_line_id.statement_id.is_edit and self.statement_line_id.statement_id.state == 'confirm': + raise UserError('Bank Statement di Lock, Minta admin reconcile untuk unlock') return res def action_post(self): @@ -145,4 +149,10 @@ class AccountMove(models.Model): 'move_ids': [x.id for x in self] } return action -
\ No newline at end of file + + def write(self, vals): + res = super(AccountMove, self).write(vals) + if self.write_date != self.create_date: + if self.statement_line_id and not self.statement_line_id.statement_id.is_edit and self.statement_line_id.statement_id.state == 'confirm': + raise UserError('Bank Statement di Lock, Minta admin reconcile untuk unlock') + return res |
