Merge lp:~pedro.baeza/openupgrade-addons/7.0-hr_holidays into lp:openupgrade-addons

Proposed by Pedro Manuel Baeza
Status: Merged
Merged at revision: 8160
Proposed branch: lp:~pedro.baeza/openupgrade-addons/7.0-hr_holidays
Merge into: lp:openupgrade-addons
Diff against target: 109 lines (+95/-0)
3 files modified
hr_holidays/migrations/7.0.1.5/openupgrade_analysis_work.txt (+60/-0)
hr_holidays/migrations/7.0.1.5/pre-migration.py (+32/-0)
hr_holidays/migrations/7.0.1.5/user_notes.txt (+3/-0)
To merge this branch: bzr merge lp:~pedro.baeza/openupgrade-addons/7.0-hr_holidays
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) code review Approve
Stefan Rijnhart (Opener) Needs Fixing
Review via email: mp+208926@code.launchpad.net

Description of the change

[ADD] hr_holidays: Partial migration script

To post a comment you must log in.
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Hi Pedro, can you please indicate in the code what is left to do?

review: Needs Information
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Hi, Stefan, it's indicated in openupgrade_analysis_work.txt. It's a minor issue, because a security group has been remove. Possible migration step can be to assign users belonging to that group to another of the remaining groups (or the new one created). It's not critical and with multiple possibilities. How do you think it's must be done?

Regards.

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

You mean the change in ir.rule? This change only reflects that in OpenERP 7.0, the manager group inherits from the user group so that the rule applies to the manager automatically. Apart from that, this particular rule only adds groups instead of overwriting them, so effectively the manager group will remain linked to the rule which is harmless. So you can remove this TODO.

I was thinking more of converting crm.case.categ to crm.meeting.type in hr.holidays.status' categ_id field but I see that the crm.case.categ model remains in OpenERP 7.0, just not in this module. So there is no logical migration path for this setting. The impact however, is very small.

It would be nice if you could note this in a file called user_notes.txt though, saying that the optional meeting types that can be configured on leave types are reset during the upgrade and may need to be reconfigured.

review: Needs Fixing
Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

Agreed with Stefan

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Thanks for the comments.

I have added user_notes.txt to explain categ_id change, and remove TODO.

Regards.

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=== added file 'hr_holidays/migrations/7.0.1.5/openupgrade_analysis_work.txt'
2--- hr_holidays/migrations/7.0.1.5/openupgrade_analysis_work.txt 1970-01-01 00:00:00 +0000
3+++ hr_holidays/migrations/7.0.1.5/openupgrade_analysis_work.txt 2014-03-27 18:51:21 +0000
4@@ -0,0 +1,60 @@
5+---Fields in module 'hr_holidays'---
6+hr_holidays / hr.employee / last_login (datetime) : module is now 'hr' ('hr_holidays')
7+### -> hr is a dependency, so this is not a problem
8+
9+hr_holidays / hr.holidays / case_id (many2one) : DEL relation: crm.meeting
10+hr_holidays / hr.holidays / meeting_id (many2one) : NEW relation: crm.meeting
11+### -> just renamed
12+
13+hr_holidays / hr.holidays / message_ids (one2many) : NEW relation: mail.message
14+### -> new functionality of mail module: nothing to do.
15+
16+hr_holidays / hr.holidays.status / categ_id (many2one) : relation is now 'crm.meeting.type' ('crm.case.categ')
17+### -> TODO: No easy migration path. Put a note in users_notes.txt
18+
19+---XML records in module 'hr_holidays'---
20+NEW ir.actions.act_window: hr_holidays.act_hr_leave_request_to_meeting
21+NEW ir.actions.act_window: hr_holidays.request_approve_allocation
22+DEL ir.actions.act_window: hr_holidays.action_view_holiday_status_manager_board
23+NEW ir.actions.act_window.view: hr_holidays.action_request_approve_allocation_form
24+NEW ir.actions.act_window.view: hr_holidays.action_request_approve_allocation_tree
25+### -> New act_window: Nothing to do
26+
27+NEW ir.actions.todo: base.open_menu
28+DEL ir.actions.todo: hr_holidays.hr_holidays_leaves_assign_form_view_todo
29+### -> New configuration wizards: Nothing to do
30+
31+NEW ir.model.access: hr_holidays.access_crm_meeting_type_manager
32+NEW ir.model.access: hr_holidays.access_resource_calendar_leaves_user
33+DEL ir.model.access: hr_holidays.access_resource_calendar_leaves_manager
34+NEW ir.rule: hr_holidays.property_rule_holidays_officer
35+DEL ir.rule: hr_holidays.property_rule_holidays_manager
36+### -> Change of rules and access. Nothing to do
37+
38+NEW ir.ui.menu: hr_holidays.menu_request_approve_allocation
39+DEL ir.ui.menu: hr_holidays.menu_hr_reporting_holidays
40+### -> New menus: Nothing to do
41+
42+DEL ir.ui.view: hr_holidays.board_hr_holidays_manager_form
43+### -> New view: Nothing to do
44+
45+NEW mail.message: hr_holidays.module_install_notification
46+NEW mail.message.subtype: hr_holidays.mt_holidays_approved
47+NEW mail.message.subtype: hr_holidays.mt_holidays_confirmed
48+NEW mail.message.subtype: hr_holidays.mt_holidays_refused
49+### -> New messages from chatter: Nothing to do
50+
51+NEW workflow.transition: hr_holidays.holiday_confirm2refuse
52+NEW workflow.transition: hr_holidays.holiday_confirm2validate
53+NEW workflow.transition: hr_holidays.holiday_confirm2validate1
54+NEW workflow.transition: hr_holidays.holiday_draft2confirm
55+NEW workflow.transition: hr_holidays.holiday_validate1_refuse
56+NEW workflow.transition: hr_holidays.holiday_validate1_validate
57+NEW workflow.transition: hr_holidays.holiday_validate2refuse
58+DEL workflow.transition: hr_holidays.t1
59+DEL workflow.transition: hr_holidays.t11
60+DEL workflow.transition: hr_holidays.t2
61+DEL workflow.transition: hr_holidays.t3
62+DEL workflow.transition: hr_holidays.t4
63+DEL workflow.transition: hr_holidays.t8
64+### -> New conditions for jump between activities: Nothing to do
65
66=== added file 'hr_holidays/migrations/7.0.1.5/pre-migration.py'
67--- hr_holidays/migrations/7.0.1.5/pre-migration.py 1970-01-01 00:00:00 +0000
68+++ hr_holidays/migrations/7.0.1.5/pre-migration.py 2014-03-27 18:51:21 +0000
69@@ -0,0 +1,32 @@
70+# -*- coding: utf-8 -*-
71+##############################################################################
72+#
73+# OpenERP, Open Source Management Solution
74+# This migration script copyright (C) 2014
75+# Pedro M. Baeza (pedro.baeza@serviciosbaeza.com)
76+#
77+# This program is free software: you can redistribute it and/or modify
78+# it under the terms of the GNU Affero General Public License as
79+# published by the Free Software Foundation, either version 3 of the
80+# License, or (at your option) any later version.
81+#
82+# This program is distributed in the hope that it will be useful,
83+# but WITHOUT ANY WARRANTY; without even the implied warranty of
84+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
85+# GNU Affero General Public License for more details.
86+#
87+# You should have received a copy of the GNU Affero General Public License
88+# along with this program. If not, see <http://www.gnu.org/licenses/>.
89+#
90+##############################################################################
91+from openupgrade import openupgrade
92+
93+column_renames = {
94+ 'hr_holidays': [
95+ ('case_id', 'meeting_id'),
96+ ]
97+}
98+
99+@openupgrade.migrate()
100+def migrate(cr, version):
101+ openupgrade.rename_columns(cr, column_renames)
102
103=== added file 'hr_holidays/migrations/7.0.1.5/user_notes.txt'
104--- hr_holidays/migrations/7.0.1.5/user_notes.txt 1970-01-01 00:00:00 +0000
105+++ hr_holidays/migrations/7.0.1.5/user_notes.txt 2014-03-27 18:51:21 +0000
106@@ -0,0 +1,3 @@
107+*******************************************************************************
108+1/ Optional meeting types that can be configured on leave types are reset
109+ during the upgrade and may need to be reconfigured.

Subscribers

People subscribed via source and target branches