-
-
Notifications
You must be signed in to change notification settings - Fork 829
8.0 'project_issue' fix priority field migration (onesteinbv) #122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| # | ||
| # Odoo, a suite of business apps | ||
| # This module Copyright (C) 2014 Therp BV (<http://therp.nl>). | ||
| # @contributor: Onestein <www.onestein.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 | ||
|
|
@@ -19,21 +20,22 @@ | |
| # | ||
| ############################################################################## | ||
|
|
||
| from openerp import SUPERUSER_ID as uid | ||
| from openerp import pooler, SUPERUSER_ID as uid | ||
| from openerp.openupgrade import openupgrade, openupgrade_80 | ||
|
|
||
|
|
||
| @openupgrade.migrate | ||
| @openupgrade.migrate() | ||
| def migrate(cr, version): | ||
| pool = pooler.get_pool(cr.dbname) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and use |
||
|
|
||
| openupgrade.map_values( | ||
| cr, | ||
| openupgrade.get_legacy_name('priority'), | ||
| 'priority', | ||
| [('5', '0'), ('4', '0'), ('3', '1'), ('2', '2'), ('1', '2')], | ||
| [('4', '0'), ('3', '0'), ('2', '1'), ('1', '2'), ('0', '2')], | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are old values: |
||
| table='project_issue', write='sql') | ||
|
|
||
| openupgrade_80.set_message_last_post(cr, uid, ['project.issue']) | ||
| openupgrade_80.set_message_last_post(cr, uid, pool, ['project.issue']) | ||
|
|
||
| openupgrade.load_data( | ||
| cr, 'project_issue', 'migrations/8.0.1.0/noupdate_changes.xml') | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| # | ||
| # Odoo, a suite of business apps | ||
| # This module Copyright (C) 2014 Therp BV (<http://therp.nl>). | ||
| # @author: Onestein <www.onestein.nl> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This must be also contributor. |
||
| # | ||
| # This program is free software: you can redistribute it and/or modify | ||
| # it under the terms of the GNU Affero General Public License as | ||
|
|
@@ -21,7 +22,9 @@ | |
|
|
||
| from openerp.openupgrade import openupgrade | ||
|
|
||
| column_renames = {'project_issue': ['priority']} | ||
| column_renames = {'project_issue': [ | ||
| ('priority', None), | ||
| ]} | ||
|
|
||
| xmlid_renames = [ | ||
| ('project_issue.mt_issue_closed', 'project_issue.mt_issue_ready'), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better do
from openerp.modules.registry import RegistryManager...