diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2023-11-04 11:53:45 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2023-11-04 11:53:45 +0700 |
| commit | f8fcf079afbe107ed8bda3e6e832b58786d2a42a (patch) | |
| tree | ce9b4cf383f23fef08af5cab8788f15727151611 | |
| parent | d05d1f609441ff0ead57d447c0ece63a968410de (diff) | |
fix error account move
| -rw-r--r-- | indoteknik_custom/models/account_move.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index c55e2e1b..ee4279b2 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -63,9 +63,10 @@ class AccountMove(models.Model): 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') + 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): @@ -152,7 +153,8 @@ class AccountMove(models.Model): 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') + 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 |
