Merge lp:~therp-nl/openupgrade-addons/6.1-prevent_automatic_chart_install into lp:openupgrade-addons/6.1

Proposed by Stefan Rijnhart (Opener)
Status: Merged
Merged at revision: 6613
Proposed branch: lp:~therp-nl/openupgrade-addons/6.1-prevent_automatic_chart_install
Merge into: lp:openupgrade-addons/6.1
Diff against target: 37 lines (+20/-0)
1 file modified
account/migrations/6.1.1.1/pre-migration.py (+20/-0)
To merge this branch: bzr merge lp:~therp-nl/openupgrade-addons/6.1-prevent_automatic_chart_install
Reviewer Review Type Date Requested Status
OpenUpgrade Committers Pending
Review via email: mp+134702@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/migrations/6.1.1.1/pre-migration.py'
2--- account/migrations/6.1.1.1/pre-migration.py 2012-06-19 09:34:23 +0000
3+++ account/migrations/6.1.1.1/pre-migration.py 2012-11-16 16:36:32 +0000
4@@ -27,6 +27,25 @@
5 logger = logging.getLogger('OpenUpgrade')
6 me = __file__
7
8+def prevent_account_installer(cr):
9+ """
10+ If the account installer has not run, e.g.
11+ after manual installation of account chart
12+ and if the company country is set, the
13+ account module will install a random
14+ chart on upgrading...
15+ """
16+ cr.execute("""
17+ UPDATE ir_actions_todo
18+ SET state = 'done'
19+ WHERE state = 'open'
20+ AND id IN (
21+ SELECT res_id
22+ FROM ir_model_data
23+ WHERE name = 'account_configuration_installer_todo'
24+ AND module = 'account')
25+ """)
26+
27 def migrate(cr, version):
28 try:
29 logger.info("%s called", me)
30@@ -55,6 +74,7 @@
31 else:
32 logger.info("%s: account type table, column report type"
33 "has already been preserved", me)
34+ prevent_account_installer(cr)
35
36 except Exception, e:
37 raise osv.except_osv("OpenUpgrade", '%s: %s' % (me, e))

Subscribers

People subscribed via source and target branches