Merge lp:~openerp-dev/openobject-server/trunk-uninstall-tpa into lp:openobject-server

Proposed by Turkesh Patel (openERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-server/trunk-uninstall-tpa
Merge into: lp:openobject-server
Diff against target: 37 lines (+13/-3)
2 files modified
openerp/addons/base/ir/ir_actions.py (+7/-0)
openerp/addons/base/ir/ir_ui_menu.py (+6/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-server/trunk-uninstall-tpa
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+139634@code.launchpad.net

Description of the change

Improved code to remove module uninstallation issues.
=====================================================================================
--> remove ir.action.todo also related to the actions otherwise it will fire that TODO and will try to find that action. And whithout action TODO is useless.
--> Improved query to find constraints to be deleted.

To post a comment you must log in.
4676. By Turkesh Patel (openERP)

[IMP] improved code and comment.

4677. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-server

4678. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-server

4679. By Turkesh Patel (openERP)

[IMP] remove now not-required changes.

4680. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-server

4681. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-server

4682. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-server

4683. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-server

4684. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-server

4685. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-server

4686. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-server

4687. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-server

4688. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-server

4689. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-addons

4690. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-server

4691. By Turkesh Patel (openERP)

[MRG] use try-except to avoid error after uninstallation of module in which we have set menu to load in context.

4692. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-server

4693. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-server

4694. By Turkesh Patel (openERP)

[IMP] improved code

4695. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-server

4696. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-server

4697. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-addons

Unmerged revisions

4697. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-addons

4696. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-server

4695. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-server

4694. By Turkesh Patel (openERP)

[IMP] improved code

4693. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-server

4692. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-server

4691. By Turkesh Patel (openERP)

[MRG] use try-except to avoid error after uninstallation of module in which we have set menu to load in context.

4690. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-server

4689. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-addons

4688. By Turkesh Patel (openERP)

[MRG] merge with lp:openobject-server

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openerp/addons/base/ir/ir_actions.py'
--- openerp/addons/base/ir/ir_actions.py 2014-04-07 17:46:28 +0000
+++ openerp/addons/base/ir/ir_actions.py 2014-04-25 10:58:25 +0000
@@ -57,6 +57,13 @@
57 'usage': lambda *a: False,57 'usage': lambda *a: False,
58 }58 }
5959
60 def unlink(self, cr, uid, ids, context=None):
61 """unlink ir.action.todo which are related to actions which will be deleted.
62 NOTE: ondelete cascade will not work on ir.actions.actions so we will need to do it manually."""
63 todo_obj = self.pool.get('ir.actions.todo')
64 todo_ids = todo_obj.search(cr, uid, [('action_id', 'in', ids)], context=context)
65 todo_obj.unlink(cr, uid, todo_ids, context=context)
66 return super(actions, self).unlink(cr, uid, ids, context=context)
6067
61class ir_actions_report_xml(osv.osv):68class ir_actions_report_xml(osv.osv):
6269
6370
=== modified file 'openerp/addons/base/ir/ir_ui_menu.py'
--- openerp/addons/base/ir/ir_ui_menu.py 2013-10-06 13:24:24 +0000
+++ openerp/addons/base/ir/ir_ui_menu.py 2014-04-25 10:58:25 +0000
@@ -312,9 +312,12 @@
312 menu_ref = [menu_ref]312 menu_ref = [menu_ref]
313 model_data_obj = self.pool.get('ir.model.data')313 model_data_obj = self.pool.get('ir.model.data')
314 for menu_data in menu_ref:314 for menu_data in menu_ref:
315 model, id = model_data_obj.get_object_reference(cr, uid, menu_data.split('.')[0], menu_data.split('.')[1])315 try:
316 if (model == 'ir.ui.menu'):316 model, id = model_data_obj.get_object_reference(cr, uid, menu_data.split('.')[0], menu_data.split('.')[1])
317 menu_ids.add(id)317 if (model == 'ir.ui.menu'):
318 menu_ids.add(id)
319 except Exception:
320 pass
318 menu_ids = list(menu_ids)321 menu_ids = list(menu_ids)
319322
320 for menu in self.browse(cr, uid, menu_ids, context=context):323 for menu in self.browse(cr, uid, menu_ids, context=context):