diff options
| author | thomas-tankengine <thomas.lemaire@ndp-systemes.fr> | 2018-04-03 12:27:27 +0200 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2018-04-04 16:31:49 +0200 |
| commit | eaf54656fcc1f50d76c4476f8a80856b0ef6da5a (patch) | |
| tree | 19a061f38ead248968307b072938fdc8a68b05d5 /addons/l10n_fr_pos_cert/models | |
| parent | 7d2f082d801d6d9a7b5852f06834ca72ac95e7dd (diff) | |
[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
Diffstat (limited to 'addons/l10n_fr_pos_cert/models')
| -rw-r--r-- | addons/l10n_fr_pos_cert/models/account_bank_statement.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/l10n_fr_pos_cert/models/account_bank_statement.py b/addons/l10n_fr_pos_cert/models/account_bank_statement.py index 28afbf0d549..f0753885bc1 100644 --- a/addons/l10n_fr_pos_cert/models/account_bank_statement.py +++ b/addons/l10n_fr_pos_cert/models/account_bank_statement.py @@ -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,)) |
