diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2025-01-15 09:25:26 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2025-01-15 09:25:26 +0700 |
| commit | a5522dfd19488f2b76ad40d3ba9750852f92da73 (patch) | |
| tree | 645b05a101eece29e203ff8ff9566e3f8388758b | |
| parent | 0e91195c3776ca6f9e9cdbdbd14803a7725b5700 (diff) | |
fix bug
| -rw-r--r-- | indoteknik_custom/models/account_move.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index e681d96e..2810c594 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -253,6 +253,11 @@ class AccountMove(models.Model): line.date_maturity = entry.date return res + def button_draft(self): + res = super(AccountMove, self).button_draft() + if not self.env.user.is_accounting: + raise UserError("Hanya Finence yang bisa ubah data") + return res def _compute_invoice_day_to_due(self): for invoice in self: @@ -318,11 +323,6 @@ class AccountMove(models.Model): 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') - def write(self, vals): - if not self.env.user.is_accounting: - raise UserError("Hanya Finence yang bisa ubah data") - return super(AccountMove, self).write(vals) - # def write(self, vals): # res = super(AccountMove, self).write(vals) # for rec in self.line_ids: |
