Merge lp:~therp-nl/openupgrade-addons/6.0-hr_expense_fix_flow_stop into lp:openupgrade-addons/6.0

Proposed by Stefan Rijnhart (Opener) on 2013-01-13
Status: Merged
Merged at revision: 4790
Proposed branch: lp:~therp-nl/openupgrade-addons/6.0-hr_expense_fix_flow_stop
Merge into: lp:openupgrade-addons/6.0
Diff against target: 42 lines (+21/-1)
2 files modified
hr_expense/migrations/6.0.1.0/data/hr_expense_workflow.xml (+8/-0)
hr_expense/migrations/6.0.1.0/post-migration.py (+13/-1)
To merge this branch: bzr merge lp:~therp-nl/openupgrade-addons/6.0-hr_expense_fix_flow_stop
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) 2013-01-13 Approve on 2013-06-03
Review via email: mp+143051@code.launchpad.net
To post a comment you must log in.
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'hr_expense/migrations/6.0.1.0/data'
2=== added file 'hr_expense/migrations/6.0.1.0/data/hr_expense_workflow.xml'
3--- hr_expense/migrations/6.0.1.0/data/hr_expense_workflow.xml 1970-01-01 00:00:00 +0000
4+++ hr_expense/migrations/6.0.1.0/data/hr_expense_workflow.xml 2013-01-13 22:07:24 +0000
5@@ -0,0 +1,8 @@
6+<?xml version="1.0" encoding="utf-8"?>
7+<openerp>
8+ <data>
9+ <record id="act_refused" model="workflow.activity">
10+ <field name="flow_stop" eval="False"/>
11+ </record>
12+ </data>
13+</openerp>
14
15=== modified file 'hr_expense/migrations/6.0.1.0/post-migration.py'
16--- hr_expense/migrations/6.0.1.0/post-migration.py 2012-06-07 14:51:52 +0000
17+++ hr_expense/migrations/6.0.1.0/post-migration.py 2013-01-13 22:07:24 +0000
18@@ -2,7 +2,7 @@
19 ##############################################################################
20 #
21 # OpenERP, Open Source Management Solution
22-# This migration script copyright (C) 2012 Therp BV (<http://therp.nl>)
23+# This migration script copyright (C) 2012-2013 Therp BV (<http://therp.nl>)
24 #
25 # This program is free software: you can redistribute it and/or modify
26 # it under the terms of the GNU Affero General Public License as
27@@ -32,3 +32,15 @@
28 def migrate(cr, version):
29 pool = pooler.get_pool(cr.dbname)
30 openupgrade.set_defaults(cr, pool, defaults_force, force=True)
31+ openupgrade.load_xml(
32+ cr, 'account',
33+ 'migrations/6.0.1.0/data/hr_expense_workflow.xml')
34+ # Fix existing workflow instances
35+ openupgrade.logged_query(
36+ cr,
37+ """
38+ UPDATE wkf_instance SET state = 'active'
39+ WHERE res_type = 'hr.expense.expense'
40+ AND res_id IN
41+ (select id from hr_expense_expense where state = 'cancelled');
42+ """)

Subscribers

People subscribed via source and target branches