Browse Source

[FIX] website_crm_recaptcha: Make uninstall work

Without this patch, after uninstalling the module, all website_crm forms will fail.
pull/658/head
Jairo Llopis 1 month ago
parent
commit
8761e601ee

+ 2
- 0
website_crm_recaptcha/__init__.py View File

@@ -1,2 +1,4 @@
# Copyright 2016-2017 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from .hooks import uninstall_hook

+ 2
- 1
website_crm_recaptcha/__manifest__.py View File

@@ -4,13 +4,14 @@
{
"name": "Website CRM - ReCaptcha",
"summary": 'Provides a ReCaptcha validation in Website Contact Form',
"version": "11.0.1.0.0",
"version": "11.0.1.0.1",
"category": "Website",
"website": "https://laslabs.com/",
"author": "LasLabs, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
'installable': True,
"uninstall_hook": "uninstall_hook",
"depends": [
"website_crm",
'website_form_recaptcha',

+ 11
- 0
website_crm_recaptcha/hooks.py View File

@@ -0,0 +1,11 @@
# 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'
""")

Loading…
Cancel
Save