Merge lp:~therp-nl/openupgrade-addons/7.0-analytic_state_to_project into lp:openupgrade-addons

Proposed by Stefan Rijnhart (Opener)
Status: Merged
Merged at revision: 8164
Proposed branch: lp:~therp-nl/openupgrade-addons/7.0-analytic_state_to_project
Merge into: lp:openupgrade-addons
Diff against target: 45 lines (+3/-6)
3 files modified
project/migrations/7.0.1.1/openupgrade_analysis_work.txt (+1/-1)
project/migrations/7.0.1.1/post-migration.py (+2/-2)
project/migrations/7.0.1.1/pre-migration.py (+0/-3)
To merge this branch: bzr merge lp:~therp-nl/openupgrade-addons/7.0-analytic_state_to_project
Reviewer Review Type Date Requested Status
Yann Papouin code review Approve
Pedro Manuel Baeza code review Approve
Review via email: mp+219435@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Thanks for making the fix, Stefan.

Regards.

review: Approve (code review)
Revision history for this message
Yann Papouin (yann-papouin) wrote :

That make sense, it's ok for me

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

I proceed with the merge due to the long delay on this MP.

Regards.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'project/migrations/7.0.1.1/openupgrade_analysis_work.txt'
--- project/migrations/7.0.1.1/openupgrade_analysis_work.txt 2014-03-10 14:27:54 +0000
+++ project/migrations/7.0.1.1/openupgrade_analysis_work.txt 2014-05-13 22:03:48 +0000
@@ -7,7 +7,7 @@
7### -> New complete model for categorizing tasks. It can be none category. (Nothing to do)7### -> New complete model for categorizing tasks. It can be none category. (Nothing to do)
88
9project / project.project / state (selection) : NEW required: required, selection_keys: ['cancelled', 'close', 'draft', 'open', 'pending', 'template'], req_default: open9project / project.project / state (selection) : NEW required: required, selection_keys: ['cancelled', 'close', 'draft', 'open', 'pending', 'template'], req_default: open
10### -> This state field has been moved from analytic account to the project. Done.10### -> This state field has been decoupled from the one on analytic account, but with the same selection -> copy its values
1111
12project / project.task / stage_id (many2one) : NEW relation: project.task.type12project / project.task / stage_id (many2one) : NEW relation: project.task.type
13project / project.task / type_id (many2one) : DEL relation: project.task.type13project / project.task / type_id (many2one) : DEL relation: project.task.type
1414
=== modified file 'project/migrations/7.0.1.1/post-migration.py'
--- project/migrations/7.0.1.1/post-migration.py 2014-05-13 21:52:19 +0000
+++ project/migrations/7.0.1.1/post-migration.py 2014-05-13 22:03:48 +0000
@@ -25,12 +25,12 @@
25def copy_state_from_analytic_account(cr):25def copy_state_from_analytic_account(cr):
26 openupgrade.logged_query(cr, """26 openupgrade.logged_query(cr, """
27 UPDATE project_project pp27 UPDATE project_project pp
28 SET state = account_analytic_account.%s28 SET state = account_analytic_account.state
29 FROM project_project29 FROM project_project
30 INNER JOIN account_analytic_account30 INNER JOIN account_analytic_account
31 ON account_analytic_account.id = project_project.analytic_account_id31 ON account_analytic_account.id = project_project.analytic_account_id
32 WHERE pp.analytic_account_id is not NULL32 WHERE pp.analytic_account_id is not NULL
33 """ %(openupgrade.get_legacy_name('state')))33 """)
3434
35def short_name(name):35def short_name(name):
36 """Keep first word(s) of name to make it small enough36 """Keep first word(s) of name to make it small enough
3737
=== modified file 'project/migrations/7.0.1.1/pre-migration.py'
--- project/migrations/7.0.1.1/pre-migration.py 2014-03-27 10:43:36 +0000
+++ project/migrations/7.0.1.1/pre-migration.py 2014-05-13 22:03:48 +0000
@@ -22,9 +22,6 @@
22from openupgrade import openupgrade22from openupgrade import openupgrade
2323
24column_renames = {24column_renames = {
25 'account_analytic_account':[
26 ('state', None),
27 ],
28 'project_task':[25 'project_task':[
29 ('type_id', 'stage_id'),26 ('type_id', 'stage_id'),
30 ],27 ],

Subscribers

People subscribed via source and target branches