Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions addons/project_issue/migrations/8.0.1.0/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -19,21 +20,22 @@
#
##############################################################################

from openerp import SUPERUSER_ID as uid
from openerp import pooler, SUPERUSER_ID as uid

Copy link
Copy Markdown
Member

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...

from openerp.openupgrade import openupgrade, openupgrade_80


@openupgrade.migrate
@openupgrade.migrate()
def migrate(cr, version):
pool = pooler.get_pool(cr.dbname)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and use pool = RegistryManager.get(cr.dbname) here in order to avoid deprecation warnings


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')],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are old values:
('1', 'Highest'), ('2', 'High'), ('3', 'Normal'), ('4', 'Low'), ('5', 'Lowest')
and these are the new ones:
('0', 'Low'), ('1', 'Normal'), ('2', 'High')
so I don't think we should change this. Previous mapping is correct.

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')
5 changes: 4 additions & 1 deletion addons/project_issue/migrations/8.0.1.0/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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
Expand All @@ -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'),
Expand Down