Skip to content
Snippets Groups Projects
Unverified Commit eaf54656 authored by thomas-tankengine's avatar thomas-tankengine Committed by Martin Trigaux
Browse files

[FIX] l10n_fr_pos_cert: set decorator on unlink

As unlink from models is still written in old API, needs to set the decorator to
avoid an error when trying to delete a bank statement

Closes #23999
parent 7d2f082d
Branches
Tags
No related merge requests found
......@@ -6,6 +6,7 @@ from openerp.exceptions import UserError
class AccountBankStatement(models.Model):
_inherit = 'account.bank.statement'
@api.multi
def unlink(self):
for statement in self.filtered(lambda s: s.company_id._is_accounting_unalterable() and s.journal_id.journal_user):
raise UserError(_('You cannot modify anything on a bank statement (name: %s) that was created by point of sale operations.') % (statement.name,))
......@@ -15,6 +16,7 @@ class AccountBankStatement(models.Model):
class AccountBankStatementLine(models.Model):
_inherit = 'account.bank.statement.line'
@api.multi
def unlink(self):
for line in self.filtered(lambda s: s.company_id._is_accounting_unalterable() and s.journal_id.journal_user):
raise UserError(_('You cannot modify anything on a bank statement line (name: %s) that was created by point of sale operations.') % (line.name,))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment