Merge lp:~therp-nl/openupgrade-addons/6.1-remove_shortcut_admin_employees into lp:openupgrade-addons/6.1

Proposed by Stefan Rijnhart (Opener)
Status: Merged
Merged at revision: 6620
Proposed branch: lp:~therp-nl/openupgrade-addons/6.1-remove_shortcut_admin_employees
Merge into: lp:openupgrade-addons/6.1
Diff against target: 32 lines (+18/-0)
1 file modified
hr/migrations/6.1.1.1/pre-migration.py (+18/-0)
To merge this branch: bzr merge lp:~therp-nl/openupgrade-addons/6.1-remove_shortcut_admin_employees
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) code review Approve
Review via email: mp+197090@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Holger Brunn (Therp) (hbrunn) :
review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hr/migrations/6.1.1.1/pre-migration.py'
--- hr/migrations/6.1.1.1/pre-migration.py 2012-10-29 19:26:29 +0000
+++ hr/migrations/6.1.1.1/pre-migration.py 2013-11-28 15:22:03 +0000
@@ -39,6 +39,23 @@
39 AND name = 'employee_resource_resource'"""39 AND name = 'employee_resource_resource'"""
40 )40 )
4141
42def remove_admin_employee_shortcut(cr):
43 """
44 Remove the shortcut that the admin user may have
45 to the list of all employees. This shortcut is
46 added as XML data in this edition, and the shortcut
47 model does not allow duplicates.
48 """
49 cr.execute("""
50 DELETE FROM ir_ui_view_sc
51 WHERE user_id IN (
52 SELECT res_id FROM ir_model_data
53 WHERE module = 'base' AND name = 'user_root')
54 AND res_id IN (
55 SELECT res_id FROM ir_model_data
56 WHERE module = 'hr' AND name = 'menu_open_view_employee_list_my')
57 """)
58
42@openupgrade.migrate()59@openupgrade.migrate()
43def migrate(cr, version):60def migrate(cr, version):
44 purge_resource_ref(cr)61 purge_resource_ref(cr)
@@ -62,3 +79,4 @@
62 ('expected_employees', openupgrade.get_legacy_name('expected_employees'))79 ('expected_employees', openupgrade.get_legacy_name('expected_employees'))
63 ],80 ],
64 })81 })
82 remove_admin_employee_shortcut(cr)

Subscribers

People subscribed via source and target branches