Merge lp:~credativ/openupgrade-addons/7.0 into lp:openupgrade-addons

Proposed by Stefan Rijnhart (Opener)
Status: Work in progress
Proposed branch: lp:~credativ/openupgrade-addons/7.0
Merge into: lp:openupgrade-addons
Diff against target: 973 lines (+854/-0)
24 files modified
analytic/migrations/7.0.1.1/post-migration.py (+37/-0)
base_calendar/migrations/7.0.1.0/post-migration.py (+27/-0)
base_calendar/migrations/7.0.1.0/pre-migration.py (+42/-0)
crm/migrations/7.0.1.0/post-migration.py (+39/-0)
crm/migrations/7.0.1.0/pre-migration.py (+33/-0)
delivery/migrations/7.0.1.0/post-migration.py (+38/-0)
document_ftp/migrations/7.0.1.99/pre-migration.py (+29/-0)
event/migrations/7.0.0.1/post-migration.py (+31/-0)
event/migrations/7.0.0.1/pre-migration.py (+32/-0)
hr/migrations/7.0.1.1/post-migration.py (+28/-0)
hr/migrations/7.0.1.1/pre-migration.py (+39/-0)
hr_holidays/migrations/7.0.1.5/pre-migration.py (+30/-0)
mail/migrations/7.0.1.0/post-migration.py (+64/-0)
mail/migrations/7.0.1.0/pre-migration.py (+50/-0)
product/migrations/7.0.1.1/pre-migration.py (+31/-0)
project/migrations/7.0.1.1/post-migration.py (+57/-0)
project/migrations/7.0.1.1/pre-migration.py (+33/-0)
project_issue/migrations/7.0.1.0/post-migration.py (+27/-0)
project_issue/migrations/7.0.1.0/pre-migration.py (+34/-0)
sale/migrations/7.0.1.0/post-migration.py (+29/-0)
sale_crm/migrations/7.0.1.0/post-migration.py (+27/-0)
sale_crm/migrations/7.0.1.0/pre-migration.py (+30/-0)
stock/migrations/7.0.1.1/post-migration.py (+37/-0)
stock/migrations/7.0.1.1/pre-migration.py (+30/-0)
To merge this branch: bzr merge lp:~credativ/openupgrade-addons/7.0
Reviewer Review Type Date Requested Status
OpenUpgrade Committers Pending
Review via email: mp+170411@code.launchpad.net

Description of the change

Please do not merge. This merge proposal is just for reference purposes. This work has been abandoned by its owner, but he offered to share it nevertheless. See https://lists.launchpad.net/openupgrade-drivers/msg00156.html

See also the server part at https://code.launchpad.net/~credativ/openupgrade-server/7.0/+merge/170414

If you are preparing parts of this code for merging into the project series, do not forget to attribute the author and copyright holder.

To post a comment you must log in.

Unmerged revisions

8140. By mistotebe

[IMP] Initial implementation for sale_crm module migration.

8139. By mistotebe

[IMP] Initial implementation for event module migration.

8138. By mistotebe

[IMP] Initial implementation for project_issue module migration.

8137. By mistotebe

[IMP] Initial implementation for delivery module migration.

8136. By mistotebe

[IMP] Initial implementation for sale module migration.

8135. By mistotebe

[IMP] Initial implementation for hr_holidays module migration.

8134. By mistotebe

[IMP] Initial implementation for stock module migration.

8133. By mistotebe

[IMP] Initial implementation for crm module migration.

8132. By mistotebe

[IMP] Initial implementation for project module migration.

8131. By mistotebe

[IMP] Initial implementation for hr module migration.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'analytic/migrations/7.0.1.1/post-migration.py'
--- analytic/migrations/7.0.1.1/post-migration.py 1970-01-01 00:00:00 +0000
+++ analytic/migrations/7.0.1.1/post-migration.py 2013-06-19 17:53:32 +0000
@@ -0,0 +1,37 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This migration script copyright (C) 2013 credativ Ltd (<http://credativ.co.uk>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.openupgrade import openupgrade
23import pooler
24
25_defaults = {
26 # False results in column value NULL
27 # None value triggers a call to the model's default function
28 'account.analytic.account' : [
29 ('type', 'normal'),
30 ],
31 }
32
33@openupgrade.migrate()
34def migrate(cr, version):
35 pool = pooler.get_pool(cr.dbname)
36 openupgrade.set_defaults(cr, pool, _defaults)
37 #TODO: move contact_id to manager_id?
038
=== added file 'base_calendar/migrations/7.0.1.0/post-migration.py'
--- base_calendar/migrations/7.0.1.0/post-migration.py 1970-01-01 00:00:00 +0000
+++ base_calendar/migrations/7.0.1.0/post-migration.py 2013-06-19 17:53:32 +0000
@@ -0,0 +1,27 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This migration script copyright (C) 2013 credativ Ltd (<http://credativ.co.uk>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openupgrade import openupgrade
23from openupgrade.openupgrade70 import partner_address_to_partner
24
25@openupgrade.migrate()
26def migrate(cr, version):
27 partner_address_to_partner(cr, 'calendar_attendee', 'partner_id')
028
=== added file 'base_calendar/migrations/7.0.1.0/pre-migration.py'
--- base_calendar/migrations/7.0.1.0/pre-migration.py 1970-01-01 00:00:00 +0000
+++ base_calendar/migrations/7.0.1.0/pre-migration.py 2013-06-19 17:53:32 +0000
@@ -0,0 +1,42 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This migration script copyright (C) 2013 credativ Ltd (<http://credativ.co.uk>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.openupgrade import openupgrade
23import logging
24
25renames = {
26 'calendar_attendee': [
27 ('partner_address_id', 'partner_id'),
28 ],
29 'calendar_event': [
30 ('recurrent_id', 'recurrent_id_date'),
31 ('recurrent_uid', 'recurrent_id'),
32 ],
33 'calendar_todo': [
34 ('recurrent_id', 'recurrent_id_date'),
35 ('recurrent_uid', 'recurrent_id'),
36 ],
37 }
38
39
40@openupgrade.migrate()
41def migrate(cr, version):
42 openupgrade.rename_columns(cr, renames)
043
=== added file 'crm/migrations/7.0.1.0/post-migration.py'
--- crm/migrations/7.0.1.0/post-migration.py 1970-01-01 00:00:00 +0000
+++ crm/migrations/7.0.1.0/post-migration.py 2013-06-19 17:53:32 +0000
@@ -0,0 +1,39 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This migration script copyright (C) 2013 credativ Ltd (<http://credativ.co.uk>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.openupgrade import openupgrade
23
24_defaults = {
25 # False results in column value NULL
26 # None value triggers a call to the model's default function
27 'crm.case.stage': [
28 ('state', 'open'),
29 ('type', 'both'),
30 ],
31 }
32
33@openupgrade.migrate()
34def migrate(cr, version):
35 pool = pooler.get_pool(cr.dbname)
36 openupgrade.set_defaults(cr, pool, _defaults)
37
38 model = pool.get('res.partner')
39 many2one2many2many(cr, model, 'res_partner', 'meeting_ids')
040
=== added file 'crm/migrations/7.0.1.0/pre-migration.py'
--- crm/migrations/7.0.1.0/pre-migration.py 1970-01-01 00:00:00 +0000
+++ crm/migrations/7.0.1.0/pre-migration.py 2013-06-19 17:53:32 +0000
@@ -0,0 +1,33 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This migration script copyright (C) 2013 credativ Ltd (<http://credativ.co.uk>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.openupgrade import openupgrade
23
24@openupgrade.migrate()
25def migrate(cr, version):
26 openupgrade.rename_columns(cr, {
27 'crm_lead': [
28 ('optout', 'opt_out'),
29 ],
30 'res.partner': [
31 ('meeting_ids', openupgrade.get_legacy_name('meeting_ids')),
32 ],
33 })
034
=== added file 'delivery/migrations/7.0.1.0/post-migration.py'
--- delivery/migrations/7.0.1.0/post-migration.py 1970-01-01 00:00:00 +0000
+++ delivery/migrations/7.0.1.0/post-migration.py 2013-06-19 17:53:32 +0000
@@ -0,0 +1,38 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This migration script copyright (C) 2013 credativ Ltd (<http://credativ.co.uk>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.openupgrade import openupgrade
23
24_defaults = {
25 # False results in column value NULL
26 # None value triggers a call to the model's default function
27 'stock.move': [
28 ('weight_uom_id', None),
29 ],
30 'stock.picking': [
31 ('weight_uom_id', None),
32 ],
33 }
34
35@openupgrade.migrate()
36def migrate(cr, version):
37 pool = pooler.get_pool(cr.dbname)
38 openupgrade.set_defaults(cr, pool, _defaults)
039
=== added file 'document_ftp/migrations/7.0.1.99/pre-migration.py'
--- document_ftp/migrations/7.0.1.99/pre-migration.py 1970-01-01 00:00:00 +0000
+++ document_ftp/migrations/7.0.1.99/pre-migration.py 2013-06-19 17:53:32 +0000
@@ -0,0 +1,29 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This migration script copyright (C) 2013 credativ Ltd (<http://credativ.co.uk>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.openupgrade import openupgrade
23
24def change_model(cr, xml_id, new_model):
25 cr.execute("UPDATE ir_model_data SET model = %s WHERE name = %s", (new_model, xml_id))
26
27@openupgrade.migrate()
28def migrate(cr, version):
29 change_model(cr, 'action_document_browse', 'ir.actions.act_url')
030
=== added file 'event/migrations/7.0.0.1/post-migration.py'
--- event/migrations/7.0.0.1/post-migration.py 1970-01-01 00:00:00 +0000
+++ event/migrations/7.0.0.1/post-migration.py 2013-06-19 17:53:32 +0000
@@ -0,0 +1,31 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This migration script copyright (C) 2013 credativ Ltd (<http://credativ.co.uk>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openupgrade import openupgrade
23from openupgrade.openupgrade70 import partner_address_to_partner
24
25@openupgrade.migrate()
26def migrate(cr, version):
27 partner_address_to_partner(cr, 'event_event', 'address_id')
28 cr.execute('UPDATE report_event_registration '\
29 'SET event_state = state, '\
30 'event_date = %s' % openupgrade.get_legacy_name('date'))
31 #TODO: moving the mail data to mail.message and linking it here
032
=== added file 'event/migrations/7.0.0.1/pre-migration.py'
--- event/migrations/7.0.0.1/pre-migration.py 1970-01-01 00:00:00 +0000
+++ event/migrations/7.0.0.1/pre-migration.py 2013-06-19 17:53:32 +0000
@@ -0,0 +1,32 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This migration script copyright (C) 2013 credativ Ltd (<http://credativ.co.uk>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.openupgrade import openupgrade
23
24@openupgrade.migrate()
25def migrate(cr, version):
26 openupgrade.rename_columns(cr, {
27 'report_event_registration': [
28 ('state', 'registration_state'),
29 ('type', 'event_type'),
30 ('date', openupgrade.get_legacy_name('date'))
31 ],
32 })
033
=== added file 'hr/migrations/7.0.1.1/post-migration.py'
--- hr/migrations/7.0.1.1/post-migration.py 1970-01-01 00:00:00 +0000
+++ hr/migrations/7.0.1.1/post-migration.py 2013-06-19 17:53:32 +0000
@@ -0,0 +1,28 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This migration script copyright (C) 2013 credativ Ltd (<http://credativ.co.uk>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openupgrade import openupgrade
23from openupgrade.openupgrade70 import partner_address_to_partner
24
25@openupgrade.migrate()
26def migrate(cr, version):
27 partner_address_to_partner(cr, 'hr_employee', 'address_id')
28 partner_address_to_partner(cr, 'hr_employee', 'address_home_id')
029
=== added file 'hr/migrations/7.0.1.1/pre-migration.py'
--- hr/migrations/7.0.1.1/pre-migration.py 1970-01-01 00:00:00 +0000
+++ hr/migrations/7.0.1.1/pre-migration.py 2013-06-19 17:53:32 +0000
@@ -0,0 +1,39 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This migration script copyright (C) 2013 credativ Ltd (<http://credativ.co.uk>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.openupgrade import openupgrade
23
24def hr_job_state(cr):
25 cr.execute(
26 "UPDATE hr_job "\
27 "SET state = 'open' "\
28 "WHERE state = 'old'"
29 )
30
31@openupgrade.migrate()
32def migrate(cr, version):
33 openupgrade.rename_columns(cr, {
34 'hr_employee': [
35 ('photo', 'image'),
36 ],
37 })
38 #TODO: what about the state=='old'?
39 #hr_job_state(cr)
040
=== added file 'hr_holidays/migrations/7.0.1.5/pre-migration.py'
--- hr_holidays/migrations/7.0.1.5/pre-migration.py 1970-01-01 00:00:00 +0000
+++ hr_holidays/migrations/7.0.1.5/pre-migration.py 2013-06-19 17:53:32 +0000
@@ -0,0 +1,30 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This migration script copyright (C) 2013 credativ Ltd (<http://credativ.co.uk>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.openupgrade import openupgrade
23
24@openupgrade.migrate()
25def migrate(cr, version):
26 openupgrade.rename_columns(cr, {
27 'hr_holidays': [
28 ('case_id', 'meeting_id'),
29 ],
30 })
031
=== added file 'mail/migrations/7.0.1.0/post-migration.py'
--- mail/migrations/7.0.1.0/post-migration.py 1970-01-01 00:00:00 +0000
+++ mail/migrations/7.0.1.0/post-migration.py 2013-06-19 17:53:32 +0000
@@ -0,0 +1,64 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This migration script copyright (C) 2013 credativ Ltd (<http://credativ.co.uk>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from osv import osv
23import pooler, logging
24from openerp.openupgrade import openupgrade
25from openerp.tools.mail import html_sanitize, plaintext2html
26
27from openerp import SUPERUSER_ID
28
29me = __file__
30_logger = logging.getLogger(__name__)
31
32subtype_mapping = {
33 'plain': (openupgrade.get_legacy_name('body_text'), plaintext2html),
34 'html': (openupgrade.get_legacy_name('body_html'), html_sanitize),
35 }
36
37def convert_mail_bodies(cr, pool):
38 msg_obj = pool.get('mail.message')
39 _logger.info("%s: converting HTML messages", me)
40 for subtype in subtype_mapping.keys():
41 field, func = subtype_mapping[subtype]
42 _logger.info("%s: converting %s messages", me, subtype)
43 cr.execute("SELECT id, %(field)s FROM mail_message " \
44 "WHERE %(msg_subtype)s = '%(subtype)s'" %
45 {
46 'msg_subtype': openupgrade.get_legacy_name('subtype'),
47 'field': field,
48 'subtype': subtype,
49 })
50 for row in cr.fetchall():
51 _logger.info("%s: message %s", me, row[0])
52 body = func(row[1])
53 cr.execute("UPDATE mail_message SET body = %s WHERE id = %s", body, row[0])
54
55
56#@openupgrade.migrate()
57def migrate(cr, version):
58 try:
59 #import ipdb; ipdb.set_trace()
60 pool = pooler.get_pool(cr.dbname)
61 convert_mail_bodies(cr, pool)
62 #TODO: what about moving the messages to mail.mail and linking them?
63 except Exception, e:
64 raise osv.except_osv("OpenUpgrade", '%s: %s' % (me, e))
065
=== added file 'mail/migrations/7.0.1.0/pre-migration.py'
--- mail/migrations/7.0.1.0/pre-migration.py 1970-01-01 00:00:00 +0000
+++ mail/migrations/7.0.1.0/pre-migration.py 2013-06-19 17:53:32 +0000
@@ -0,0 +1,50 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This migration script copyright (C) 2013 credativ Ltd (<http://credativ.co.uk>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.openupgrade import openupgrade
23import logging
24
25renames = {
26 'mail_message': [
27 ('subtype', openupgrade.get_legacy_name('subtype')),
28 ('body_html', openupgrade.get_legacy_name('body_html')),
29 ('body_text', openupgrade.get_legacy_name('body_text')),
30 ]
31 }
32
33# there is a cyclic dependency in the module that cannot be handled without
34# creating these columns first
35def add_column(cr, column_spec):
36 for table in column_spec.keys():
37 for (name, typ) in column_spec[table]:
38 cr.execute('ALTER TABLE "%s" ADD COLUMN "%s" %s' % (table, name, typ))
39
40@openupgrade.migrate()
41def migrate(cr, version):
42 openupgrade.rename_columns(cr, renames)
43 add_column(cr, {
44 'res_users': [
45 ('alias_id', 'INTEGER'),
46 ],
47 'res_partner': [
48 ('notification_email_send', 'char'),
49 ],
50 })
051
=== added file 'product/migrations/7.0.1.1/pre-migration.py'
--- product/migrations/7.0.1.1/pre-migration.py 1970-01-01 00:00:00 +0000
+++ product/migrations/7.0.1.1/pre-migration.py 2013-06-19 17:53:32 +0000
@@ -0,0 +1,31 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This migration script copyright (C) 2013 credativ Ltd (<http://credativ.co.uk>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.openupgrade import openupgrade
23
24@openupgrade.migrate()
25def migrate(cr, version):
26 openupgrade.rename_columns(cr, {
27 'product_product': [
28 ('product_image', 'image'),
29 ],
30 })
31 #TODO: what about moving selection = 'product'?
032
=== added file 'project/migrations/7.0.1.1/post-migration.py'
--- project/migrations/7.0.1.1/post-migration.py 1970-01-01 00:00:00 +0000
+++ project/migrations/7.0.1.1/post-migration.py 2013-06-19 17:53:32 +0000
@@ -0,0 +1,57 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This migration script copyright (C) 2013 credativ Ltd (<http://credativ.co.uk>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.openupgrade import openupgrade
23
24from openerp import SUPERUSER_ID
25from openerp.addons.project.project import short_name
26
27_defaults = {
28 # False results in column value NULL
29 # None value triggers a call to the model's default function
30 'project.project': [
31 ('name', 'unknown'),
32 ('alias_model', 'project.task'),
33 ('privacy_visibility', 'public'),
34 ('state', 'open'),
35 ],
36 'project.task.type': [
37 ('state', 'open'),
38 ],
39 }
40
41def assign_mail_alias(cr, pool):
42 mail_alias = pool.get('mail.alias')
43
44 projects = pool.get("project.project")
45 project_ids = projects.search(cr, SUPERUSER_ID, [])
46
47 for project in projects.browse(cr, SUPERUSER_ID, project_ids):
48 alias_id = mail_alias.create_unique_alias(cr, SUPERUSER_ID,
49 {'alias_name': "project+project" + short_name(project.name)},
50 model_name=project.alias_model)
51 projects.write(cr, SUPERUSER_ID, [project['id']], {'alias_id': alias_id})
52
53@openupgrade.migrate()
54def migrate(cr, version):
55 pool = pooler.get_pool(cr.dbname)
56 openupgrade.set_defaults(cr, pool, _defaults)
57 assign_mail_alias(cr, pool)
058
=== added file 'project/migrations/7.0.1.1/pre-migration.py'
--- project/migrations/7.0.1.1/pre-migration.py 1970-01-01 00:00:00 +0000
+++ project/migrations/7.0.1.1/pre-migration.py 2013-06-19 17:53:32 +0000
@@ -0,0 +1,33 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This migration script copyright (C) 2013 credativ Ltd (<http://credativ.co.uk>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.openupgrade import openupgrade
23
24@openupgrade.migrate()
25def migrate(cr, version):
26 openupgrade.rename_columns(cr, {
27 'project_task': [
28 ('type_id', 'stage_id'),
29 ],
30 'project_task_type': [
31 ('project_default', 'case_default'),
32 ],
33 })
034
=== added file 'project_issue/migrations/7.0.1.0/post-migration.py'
--- project_issue/migrations/7.0.1.0/post-migration.py 1970-01-01 00:00:00 +0000
+++ project_issue/migrations/7.0.1.0/post-migration.py 2013-06-19 17:53:32 +0000
@@ -0,0 +1,27 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This migration script copyright (C) 2013 credativ Ltd (<http://credativ.co.uk>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.openupgrade import openupgrade
23
24@openupgrade.migrate()
25def migrate(cr, version):
26 model = pool.get('sale.order')
27 many2one2many2many(cr, model, 'project_issue', 'categ_ids', openupgrade.get_legacy_name('categ_id'))
028
=== added file 'project_issue/migrations/7.0.1.0/pre-migration.py'
--- project_issue/migrations/7.0.1.0/pre-migration.py 1970-01-01 00:00:00 +0000
+++ project_issue/migrations/7.0.1.0/pre-migration.py 2013-06-19 17:53:32 +0000
@@ -0,0 +1,34 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This migration script copyright (C) 2013 credativ Ltd (<http://credativ.co.uk>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.openupgrade import openupgrade
23
24@openupgrade.migrate()
25def migrate(cr, version):
26 openupgrade.rename_columns(cr, {
27 'project_issue': [
28 ('categ_id', openupgrade.get_legacy_name('categ_id')),
29 ('type_id', 'stage_id'),
30 ],
31 'project_issue': [
32 ('type_id', 'stage_id'),
33 ],
34 })
035
=== added file 'sale/migrations/7.0.1.0/post-migration.py'
--- sale/migrations/7.0.1.0/post-migration.py 1970-01-01 00:00:00 +0000
+++ sale/migrations/7.0.1.0/post-migration.py 2013-06-19 17:53:32 +0000
@@ -0,0 +1,29 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This migration script copyright (C) 2013 credativ Ltd (<http://credativ.co.uk>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openupgrade import openupgrade
23from openupgrade.openupgrade70 import partner_address_to_partner
24
25@openupgrade.migrate()
26def migrate(cr, version):
27 partner_address_to_partner(cr, 'sale_order', 'partner_invoice_id')
28 partner_address_to_partner(cr, 'sale_order', 'partner_shipping_id')
29 partner_address_to_partner(cr, 'sale_order_line', 'address_allotment_id')
030
=== added file 'sale_crm/migrations/7.0.1.0/post-migration.py'
--- sale_crm/migrations/7.0.1.0/post-migration.py 1970-01-01 00:00:00 +0000
+++ sale_crm/migrations/7.0.1.0/post-migration.py 2013-06-19 17:53:32 +0000
@@ -0,0 +1,27 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This migration script copyright (C) 2013 credativ Ltd (<http://credativ.co.uk>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.openupgrade import openupgrade
23
24@openupgrade.migrate()
25def migrate(cr, version):
26 model = pool.get('sale.order')
27 many2one2many2many(cr, model, 'sale_order', 'categ_ids', openupgrade.get_legacy_name('categ_id'))
028
=== added file 'sale_crm/migrations/7.0.1.0/pre-migration.py'
--- sale_crm/migrations/7.0.1.0/pre-migration.py 1970-01-01 00:00:00 +0000
+++ sale_crm/migrations/7.0.1.0/pre-migration.py 2013-06-19 17:53:32 +0000
@@ -0,0 +1,30 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This migration script copyright (C) 2013 credativ Ltd (<http://credativ.co.uk>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.openupgrade import openupgrade
23
24@openupgrade.migrate()
25def migrate(cr, version):
26 openupgrade.rename_columns(cr, {
27 'sale_order': [
28 ('categ_id', openupgrade.get_legacy_name('categ_id')),
29 ],
30 })
031
=== added file 'stock/migrations/7.0.1.1/post-migration.py'
--- stock/migrations/7.0.1.1/post-migration.py 1970-01-01 00:00:00 +0000
+++ stock/migrations/7.0.1.1/post-migration.py 2013-06-19 17:53:32 +0000
@@ -0,0 +1,37 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This migration script copyright (C) 2013 credativ Ltd (<http://credativ.co.uk>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openupgrade import openupgrade
23from openupgrade.openupgrade70 import partner_address_to_partner
24
25_tables_with_address = [
26 'report_stock_inventory',
27 'report_stock_move',
28 'stock_location',
29 'stock_move',
30 'stock_picking',
31 'stock_warehouse',
32 ]
33
34@openupgrade.migrate()
35def migrate(cr, version):
36 for table in _tables_with_address:
37 partner_address_to_partner(cr, table, 'partner_id')
038
=== added file 'stock/migrations/7.0.1.1/pre-migration.py'
--- stock/migrations/7.0.1.1/pre-migration.py 1970-01-01 00:00:00 +0000
+++ stock/migrations/7.0.1.1/pre-migration.py 2013-06-19 17:53:32 +0000
@@ -0,0 +1,30 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This migration script copyright (C) 2013 credativ Ltd (<http://credativ.co.uk>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.openupgrade import openupgrade
23
24@openupgrade.migrate()
25def migrate(cr, version):
26 openupgrade.rename_columns(cr, {
27 'stock_location': [('address_id', 'partner_id')],
28 'stock_move': [('address_id', 'partner_id')],
29 'stock_picking': [('address_id', 'partner_id')],
30 })

Subscribers

People subscribed via source and target branches