credativ team mailing list archive
-
credativ team
-
Mailing list archive
-
Message #05097
[Merge] lp:~therp-nl/openupgrade-addons/6.0-hr_expense_fix_flow_stop into lp:openupgrade-addons/6.0
Stefan Rijnhart (Therp) has proposed merging lp:~therp-nl/openupgrade-addons/6.0-hr_expense_fix_flow_stop into lp:openupgrade-addons/6.0.
Requested reviews:
OpenUpgrade Committers (openupgrade-committers)
For more details, see:
https://code.launchpad.net/~therp-nl/openupgrade-addons/6.0-hr_expense_fix_flow_stop/+merge/143051
--
https://code.launchpad.net/~therp-nl/openupgrade-addons/6.0-hr_expense_fix_flow_stop/+merge/143051
Your team OpenUpgrade Committers is requested to review the proposed merge of lp:~therp-nl/openupgrade-addons/6.0-hr_expense_fix_flow_stop into lp:openupgrade-addons/6.0.
=== added directory 'hr_expense/migrations/6.0.1.0/data'
=== added file 'hr_expense/migrations/6.0.1.0/data/hr_expense_workflow.xml'
--- hr_expense/migrations/6.0.1.0/data/hr_expense_workflow.xml 1970-01-01 00:00:00 +0000
+++ hr_expense/migrations/6.0.1.0/data/hr_expense_workflow.xml 2013-01-13 22:07:24 +0000
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="act_refused" model="workflow.activity">
+ <field name="flow_stop" eval="False"/>
+ </record>
+ </data>
+</openerp>
=== modified file 'hr_expense/migrations/6.0.1.0/post-migration.py'
--- hr_expense/migrations/6.0.1.0/post-migration.py 2012-06-07 14:51:52 +0000
+++ hr_expense/migrations/6.0.1.0/post-migration.py 2013-01-13 22:07:24 +0000
@@ -2,7 +2,7 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
-# This migration script copyright (C) 2012 Therp BV (<http://therp.nl>)
+# This migration script copyright (C) 2012-2013 Therp BV (<http://therp.nl>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@@ -32,3 +32,15 @@
def migrate(cr, version):
pool = pooler.get_pool(cr.dbname)
openupgrade.set_defaults(cr, pool, defaults_force, force=True)
+ openupgrade.load_xml(
+ cr, 'account',
+ 'migrations/6.0.1.0/data/hr_expense_workflow.xml')
+ # Fix existing workflow instances
+ openupgrade.logged_query(
+ cr,
+ """
+ UPDATE wkf_instance SET state = 'active'
+ WHERE res_type = 'hr.expense.expense'
+ AND res_id IN
+ (select id from hr_expense_expense where state = 'cancelled');
+ """)