diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2023-11-09 09:55:34 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2023-11-09 09:55:34 +0700 |
| commit | 14156f7d6f55eaa4e74310ee1aa4e5128aa17fff (patch) | |
| tree | 8120cf7da795977f9602cc80b52a795673b83d35 /indoteknik_custom/models/account_move.py | |
| parent | c9a54676b0ba5b1e27e3619cd0443031bdd27fda (diff) | |
mandatory static npwp,sppkp,customer_type in sale order and fix log note journal entries
Diffstat (limited to 'indoteknik_custom/models/account_move.py')
| -rw-r--r-- | indoteknik_custom/models/account_move.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 4e1beb3a..fe9db583 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -151,10 +151,16 @@ class AccountMove(models.Model): } return action - def write(self, vals): - res = super(AccountMove, self).write(vals) + @api.constrains('efaktur_id', 'ref', 'date', 'journal_id', 'name') + def constrains_edit(self): for rec in self.line_ids: - 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 + 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): + # res = super(AccountMove, self).write(vals) + # for rec in self.line_ids: + # 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 |
