Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] website_crm_recaptcha: Make uninstall work
Without this patch, after uninstalling the module, all website_crm forms will fail.
- Loading branch information
1 parent
dc063fb
commit 53ed0e5
Showing
3 changed files
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from .hooks import uninstall_hook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' | ||
""") |