From f8e41cbd0a5fc82eacdee8bf3db29af424961b3d Mon Sep 17 00:00:00 2001 From: app Date: Fri, 4 Dec 2015 18:10:05 +0000 Subject: [PATCH] Fix partner notify_email before uninstall --- im_notif/__init__.py | 7 +++++++ im_notif/__openerp__.py | 1 + 2 files changed, 8 insertions(+) diff --git a/im_notif/__init__.py b/im_notif/__init__.py index 6ff86bc..38fa180 100644 --- a/im_notif/__init__.py +++ b/im_notif/__init__.py @@ -1 +1,8 @@ import im_notif_models + + +def pre_uninstall(cr, registry): + query = ("UPDATE res_partner " + "SET notify_email = 'always' " + "WHERE notify_email LIKE 'im%';") + cr.execute(query) diff --git a/im_notif/__openerp__.py b/im_notif/__openerp__.py index ee688a9..9dcc6d6 100644 --- a/im_notif/__openerp__.py +++ b/im_notif/__openerp__.py @@ -14,4 +14,5 @@ 'im_notif_views.xml', ], 'installable': True + 'uninstall_hook': 'pre_uninstall', }