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
1=== modified file 'hr/migrations/6.1.1.1/pre-migration.py'
2--- hr/migrations/6.1.1.1/pre-migration.py 2012-10-29 19:26:29 +0000
3+++ hr/migrations/6.1.1.1/pre-migration.py 2013-11-28 15:22:03 +0000
4@@ -39,6 +39,23 @@
5 AND name = 'employee_resource_resource'"""
6 )
7
8+def remove_admin_employee_shortcut(cr):
9+ """
10+ Remove the shortcut that the admin user may have
11+ to the list of all employees. This shortcut is
12+ added as XML data in this edition, and the shortcut
13+ model does not allow duplicates.
14+ """
15+ cr.execute("""
16+ DELETE FROM ir_ui_view_sc
17+ WHERE user_id IN (
18+ SELECT res_id FROM ir_model_data
19+ WHERE module = 'base' AND name = 'user_root')
20+ AND res_id IN (
21+ SELECT res_id FROM ir_model_data
22+ WHERE module = 'hr' AND name = 'menu_open_view_employee_list_my')
23+ """)
24+
25 @openupgrade.migrate()
26 def migrate(cr, version):
27 purge_resource_ref(cr)
28@@ -62,3 +79,4 @@
29 ('expected_employees', openupgrade.get_legacy_name('expected_employees'))
30 ],
31 })
32+ remove_admin_employee_shortcut(cr)

Subscribers

People subscribed via source and target branches