diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2023-11-06 08:50:31 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2023-11-06 08:50:31 +0700 |
| commit | b3e90d317b993b23c549fc985231a59df9f8c352 (patch) | |
| tree | 4d272d80e930a735248a35a63594d88092c47952 /indoteknik_custom/models/account_move.py | |
| parent | efa51f6b1c5254996db90a90468241da303a7e21 (diff) | |
| parent | f8fcf079afbe107ed8bda3e6e832b58786d2a42a (diff) | |
Merge branch 'production' into commision-window
Diffstat (limited to 'indoteknik_custom/models/account_move.py')
| -rw-r--r-- | indoteknik_custom/models/account_move.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index a85e8caa..ee4279b2 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -62,6 +62,11 @@ 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') + + for rec in self: + if rec.write_date != rec.create_date: + 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') return res def action_post(self): @@ -145,4 +150,11 @@ 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) + for rec in self: + if rec.write_date != rec.create_date: + 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') + return res |
