mirror of
https://github.com/brain-tec/account_ebics.git
synced 2026-11-06 10:00:39 +00:00
[FIX] account_ebics - Block removal of confirmed EBICS configurations
The ondelete guard checked state "active", which ebics.config does not have (draft/confirm), so confirmed configurations could be deleted. Same check as on 19.0.
This commit is contained in:
1 parent
f44076ff69
commit
f9b94beb68
1 file changed
+2
-2
@@ -161,8 +161,8 @@ class EbicsConfig(models.Model):
|
||||
rec.company_ids = rec.journal_ids.mapped("company_id")
|
||||
|
||||
@api.ondelete(at_uninstall=False)
|
||||
def _unlink_except_active(self):
|
||||
if any(rec.state == "active" for rec in self):
|
||||
def _unlink_except_confirm(self):
|
||||
if any(rec.state == "confirm" for rec in self):
|
||||
raise UserError(
|
||||
self.env._("You cannot remove active EBICS configurations.")
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user