credativ team mailing list archive
-
credativ team
-
Mailing list archive
-
Message #06050
Re: [Merge] lp:~savoirfairelinux-openerp/openupgrade-addons/sale_crm into lp:openupgrade-addons
Review: Needs Fixing code review
Some comments inline
Diff comments:
> === added file 'openupgrade_analysis_work.txt'
> --- openupgrade_analysis_work.txt 1970-01-01 00:00:00 +0000
> +++ openupgrade_analysis_work.txt 2014-09-10 14:45:34 +0000
> @@ -0,0 +1,26 @@
> +---Fields in module 'sale_crm'---
> +
> +# Nothing done
Do you mean 'Nothing to do'?
> +sale_crm / account.invoice / section_id (many2one) : NEW relation: crm.case.section
> +sale_crm / account.invoice.report / section_id (many2one) : NEW relation: crm.case.section
> +sale_crm / res.users / default_section_id (many2one) : NEW relation: crm.case.section
> +
> +
> +# Covert from m2o to m2m
s/Covert/Convert
> +sale_crm / sale.order / categ_id (many2one) : DEL relation: crm.case.categ
> +sale_crm / sale.order / categ_ids (many2many) : NEW relation: crm.case.categ
> +
> +
> +# Nothing done
Do you mean 'Nothing to do'?
> +---XML records in module 'sale_crm'---
> +DEL ir.ui.menu: base.menu_base_partner
> +NEW ir.ui.view: sale_crm.account_invoice_form
> +NEW ir.ui.view: sale_crm.account_invoice_groupby_inherit
> +NEW ir.ui.view: sale_crm.account_invoice_report_tree
> +NEW ir.ui.view: sale_crm.account_invoice_tree
> +NEW ir.ui.view: sale_crm.res_user_form
> +NEW ir.ui.view: sale_crm.view_users_form_preferences
> +DEL ir.ui.view: sale_crm.board_crm_form_inherit_replace1
> +DEL ir.ui.view: sale_crm.board_crm_form_inherit_replace3
> +NEW mail.message.subtype: sale_crm.mt_salesteam_order_confirmed
> +NEW mail.message.subtype: sale_crm.mt_salesteam_order_sent
>
> === added file 'post-migration.py'
> --- post-migration.py 1970-01-01 00:00:00 +0000
> +++ post-migration.py 2014-09-10 14:45:34 +0000
> @@ -0,0 +1,31 @@
> +# -*- encoding: utf-8 -*-
> +##############################################################################
> +#
> +# OpenERP, Open Source Management Solution
> +# This module copyright (C) 2014 Savoir-faire Linux
> +# (<http://www.savoirfairelinux.com>).
> +#
> +# This program is free software: you can redistribute it and/or modify
> +# it under the terms of the GNU Affero General Public License as
> +# published by the Free Software Foundation, either version 3 of the
> +# License, or (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU Affero General Public License for more details.
> +#
> +# You should have received a copy of the GNU Affero General Public License
> +# along with this program. If not, see <http://www.gnu.org/licenses/>.
> +#
> +##############################################################################
> +
> +from openerp import pooler
> +from openupgrade import openupgrade
> +
> +
> +@openupgrade.migrate()
> +def migrate(cr, version):
> + pool = pooler.get_pool(cr.dbname)
Put:
if not version:
return
to avoid the execution in each initialisation.
> + openupgrade.m2o_to_m2m(cr, pool['sale.order'], 'sale_order', 'categ_ids',
> + openupgrade.get_legacy_name('categ_id'))
>
> === added file 'pre-migration.py'
> --- pre-migration.py 1970-01-01 00:00:00 +0000
> +++ pre-migration.py 2014-09-10 14:45:34 +0000
> @@ -0,0 +1,34 @@
> +# -*- encoding: utf-8 -*-
> +##############################################################################
> +#
> +# OpenERP, Open Source Management Solution
> +# This module copyright (C) 2014 Savoir-faire Linux
> +# (<http://www.savoirfairelinux.com>).
> +#
> +# This program is free software: you can redistribute it and/or modify
> +# it under the terms of the GNU Affero General Public License as
> +# published by the Free Software Foundation, either version 3 of the
> +# License, or (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU Affero General Public License for more details.
> +#
> +# You should have received a copy of the GNU Affero General Public License
> +# along with this program. If not, see <http://www.gnu.org/licenses/>.
> +#
> +##############################################################################
> +
> +from openupgrade import openupgrade
> +
> +column_renames = {
> + 'sale_order': [
> + ('categ_id', None),
> + ],
> +}
> +
> +
> +@openupgrade.migrate()
> +def migrate(cr, version):
> + openupgrade.rename_columns(cr, column_renames)
Put:
if not version:
return
to avoid the execution in each initialisation.
>
--
https://code.launchpad.net/~savoirfairelinux-openerp/openupgrade-addons/sale_crm/+merge/234126
Your team OpenUpgrade Committers is subscribed to branch lp:openupgrade-addons.
References