summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/account_move.py
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom/models/account_move.py')
-rw-r--r--indoteknik_custom/models/account_move.py14
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