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
1=== modified file 'project/migrations/7.0.1.1/openupgrade_analysis_work.txt'
2--- project/migrations/7.0.1.1/openupgrade_analysis_work.txt 2014-03-10 14:27:54 +0000
3+++ project/migrations/7.0.1.1/openupgrade_analysis_work.txt 2014-05-13 22:03:48 +0000
4@@ -7,7 +7,7 @@
5 ### -> New complete model for categorizing tasks. It can be none category. (Nothing to do)
6
7 project / project.project / state (selection) : NEW required: required, selection_keys: ['cancelled', 'close', 'draft', 'open', 'pending', 'template'], req_default: open
8-### -> This state field has been moved from analytic account to the project. Done.
9+### -> This state field has been decoupled from the one on analytic account, but with the same selection -> copy its values
10
11 project / project.task / stage_id (many2one) : NEW relation: project.task.type
12 project / project.task / type_id (many2one) : DEL relation: project.task.type
13
14=== modified file 'project/migrations/7.0.1.1/post-migration.py'
15--- project/migrations/7.0.1.1/post-migration.py 2014-05-13 21:52:19 +0000
16+++ project/migrations/7.0.1.1/post-migration.py 2014-05-13 22:03:48 +0000
17@@ -25,12 +25,12 @@
18 def copy_state_from_analytic_account(cr):
19 openupgrade.logged_query(cr, """
20 UPDATE project_project pp
21- SET state = account_analytic_account.%s
22+ SET state = account_analytic_account.state
23 FROM project_project
24 INNER JOIN account_analytic_account
25 ON account_analytic_account.id = project_project.analytic_account_id
26 WHERE pp.analytic_account_id is not NULL
27- """ %(openupgrade.get_legacy_name('state')))
28+ """)
29
30 def short_name(name):
31 """Keep first word(s) of name to make it small enough
32
33=== modified file 'project/migrations/7.0.1.1/pre-migration.py'
34--- project/migrations/7.0.1.1/pre-migration.py 2014-03-27 10:43:36 +0000
35+++ project/migrations/7.0.1.1/pre-migration.py 2014-05-13 22:03:48 +0000
36@@ -22,9 +22,6 @@
37 from openupgrade import openupgrade
38
39 column_renames = {
40- 'account_analytic_account':[
41- ('state', None),
42- ],
43 'project_task':[
44 ('type_id', 'stage_id'),
45 ],

Subscribers

People subscribed via source and target branches