Skip to content

Commit

Permalink
[FIX] website_crm_recaptcha: Make uninstall work
Browse files Browse the repository at this point in the history
Without this patch, after uninstalling the module, all website_crm forms will fail.
  • Loading branch information
yajo authored and OCA-git-bot committed Aug 26, 2019
1 parent dc063fb commit 53ed0e5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions website_crm_recaptcha/__init__.py
@@ -1 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from .hooks import uninstall_hook
1 change: 1 addition & 0 deletions website_crm_recaptcha/__manifest__.py
Expand Up @@ -12,6 +12,7 @@
"license": "AGPL-3",
"application": False,
'installable': True,
"uninstall_hook": "uninstall_hook",
"depends": [
"website_crm",
'website_form_recaptcha',
Expand Down
10 changes: 10 additions & 0 deletions website_crm_recaptcha/hooks.py
@@ -0,0 +1,10 @@
# Copyright 2019 Tecnativa - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

def uninstall_hook(cr, registry):
"""Unmark crm.lead as recaptcha model."""
cr.execute("""
UPDATE ir_model
SET website_form_recaptcha = FALSE
WHERE model = 'crm.lead'
""")

0 comments on commit 53ed0e5

Please sign in to comment.