From 48fd1d33d1f90fb2e17fee0d360bcd543c0f2868 Mon Sep 17 00:00:00 2001 From: Sylvain Calador Date: Wed, 1 Apr 2015 12:16:24 +0200 Subject: [PATCH] [IMP] Restore POS category menu action when uninstall --- pos_product_category/module.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pos_product_category/module.py b/pos_product_category/module.py index bcabab40..f3972a92 100644 --- a/pos_product_category/module.py +++ b/pos_product_category/module.py @@ -52,6 +52,17 @@ class Module(models.Model): REFERENCES pos_category(id) ON DELETE SET NULL; ''') + # Restore POS category menu action + # in SQL because pool/env is not available here + cr.execute(''' + UPDATE ir_act_window iaw SET res_model='pos.category' + FROM ir_model_data imd + WHERE + iaw.id = imd.res_id AND + imd.model = 'ir.actions.act_window' AND + imd.name = 'product_pos_category_action' + ''') + break return super(Module, self).module_uninstall(