From c726ab8d3aafe19f1d9cd8b5b9fc260541314e5c 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 | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) 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 33f1606..812ccc3 100644 --- a/im_notif/__openerp__.py +++ b/im_notif/__openerp__.py @@ -13,5 +13,6 @@ 'im_notif_data.xml', 'im_notif_views.xml', ], - 'installable': False + 'installable': False, + 'uninstall_hook': 'pre_uninstall', }