← Back to team overview

credativ team mailing list archive

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

 

Stefan Rijnhart (Therp) has proposed merging lp:~therp-nl/openupgrade-addons/6.1-remove_shortcut_admin_employees into lp:openupgrade-addons/6.1.

Requested reviews:
  OpenUpgrade Committers (openupgrade-committers)

For more details, see:
https://code.launchpad.net/~therp-nl/openupgrade-addons/6.1-remove_shortcut_admin_employees/+merge/197090
-- 
https://code.launchpad.net/~therp-nl/openupgrade-addons/6.1-remove_shortcut_admin_employees/+merge/197090
Your team OpenUpgrade Committers is requested to review the proposed merge of lp:~therp-nl/openupgrade-addons/6.1-remove_shortcut_admin_employees into lp:openupgrade-addons/6.1.
=== 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 @@
             AND name = 'employee_resource_resource'"""
             )
 
+def remove_admin_employee_shortcut(cr):
+    """
+    Remove the shortcut that the admin user may have
+    to the list of all employees. This shortcut is
+    added as XML data in this edition, and the shortcut
+    model does not allow duplicates.
+    """
+    cr.execute("""
+        DELETE FROM ir_ui_view_sc
+        WHERE user_id IN (
+           SELECT res_id FROM ir_model_data
+           WHERE module = 'base' AND name = 'user_root')
+        AND res_id IN (
+           SELECT res_id FROM ir_model_data
+           WHERE module = 'hr' AND name = 'menu_open_view_employee_list_my')
+        """)
+
 @openupgrade.migrate()
 def migrate(cr, version):
     purge_resource_ref(cr)
@@ -62,3 +79,4 @@
                     ('expected_employees', openupgrade.get_legacy_name('expected_employees'))
                 ],
             })
+    remove_admin_employee_shortcut(cr)


Follow ups