Skip to content

Commit

Permalink
Merge pull request OCA#458 from ZhenIT/6.0
Browse files Browse the repository at this point in the history
[FIX] Warings about using openupgradelib
  • Loading branch information
hbrunn committed Apr 2, 2016
2 parents 5f48ad1 + c17db94 commit 83614f5
Show file tree
Hide file tree
Showing 40 changed files with 39 additions and 43 deletions.
2 changes: 1 addition & 1 deletion addons/account/migrations/6.0.1.1/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##############################################################################

import pooler
from openupgrade import openupgrade
from openupgradelib import openupgrade

defaults = {
# False results in column value NULL
Expand Down
2 changes: 1 addition & 1 deletion addons/account/migrations/6.0.1.1/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##############################################################################

from tools import sql
from openupgrade import openupgrade
from openupgradelib import openupgrade

column_renames = {
# this is a mapping per table from old column name
Expand Down
2 changes: 1 addition & 1 deletion addons/account_budget/migrations/6.0.1.0/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##############################################################################

import pooler
from openupgrade import openupgrade
from openupgradelib import openupgrade

MODULE='account_budget'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##############################################################################

import pooler
from openupgrade import openupgrade
from openupgradelib import openupgrade

defaults_force = {
# False results in column value NULL
Expand Down
2 changes: 1 addition & 1 deletion addons/account_payment/migrations/6.0.1.1/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
##############################################################################

from openupgrade import openupgrade
from openupgradelib import openupgrade

column_renames = {
# this is a mapping per table from old column name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
##############################################################################

from openupgrade import openupgrade
from openupgradelib import openupgrade

@openupgrade.migrate()
def migrate(cr, version):
Expand Down
2 changes: 1 addition & 1 deletion addons/hr/migrations/6.0.1.1/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##############################################################################

import pooler, logging
from openupgrade import openupgrade
from openupgradelib import openupgrade

logger = logging.getLogger('OpenUpgrade: hr')

Expand Down
2 changes: 1 addition & 1 deletion addons/hr/migrations/6.0.1.1/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
##############################################################################

from openupgrade import openupgrade
from openupgradelib import openupgrade

column_renames = {
# this is a mapping per table from old column name
Expand Down
2 changes: 1 addition & 1 deletion addons/hr_contract/migrations/6.0.1.0/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##############################################################################

import pooler, logging
from openupgrade import openupgrade
from openupgradelib import openupgrade

logger = logging.getLogger('migrate')
MODULE = 'hr_contract'
Expand Down
2 changes: 1 addition & 1 deletion addons/hr_contract/migrations/6.0.1.0/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
##############################################################################

from openupgrade import openupgrade
from openupgradelib import openupgrade

column_renames = {
# this is a mapping per table from old column name
Expand Down
2 changes: 1 addition & 1 deletion addons/hr_expense/migrations/6.0.1.0/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##############################################################################

import pooler
from openupgrade import openupgrade
from openupgradelib import openupgrade

defaults_force = {
'hr.expense.expense': [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##############################################################################

import pooler
from openupgrade import openupgrade
from openupgradelib import openupgrade

defaults_force = {
'hr_timesheet_sheet.sheet':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
##############################################################################

from openupgrade import openupgrade
from openupgradelib import openupgrade

column_renames = {
# this is a mapping per table from old column name
Expand Down
2 changes: 1 addition & 1 deletion addons/membership/migrations/6.0.0.1/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
##############################################################################

from openupgrade import openupgrade
from openupgradelib import openupgrade

@openupgrade.migrate()
def migrate(cr, version):
Expand Down
2 changes: 1 addition & 1 deletion addons/mrp/migrations/6.0.1.1/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##############################################################################

import pooler
from openupgrade import openupgrade
from openupgradelib import openupgrade

defaults_force = {
'mrp.bom': [('company_id', None)],
Expand Down
2 changes: 1 addition & 1 deletion addons/mrp/migrations/6.0.1.1/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
##############################################################################

from openupgrade import openupgrade
from openupgradelib import openupgrade

column_renames = {
'mrp_production': [
Expand Down
2 changes: 1 addition & 1 deletion addons/procurement/migrations/6.0.1.0/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##############################################################################

import pooler
from openupgrade import openupgrade
from openupgradelib import openupgrade

defaults_force = {
'procurement.order': [('company_id', None)],
Expand Down
2 changes: 1 addition & 1 deletion addons/procurement/migrations/6.0.1.0/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##############################################################################

import logging
from openupgrade import openupgrade
from openupgradelib import openupgrade

logger = logging.getLogger('OpenUpgrade: procurement')

Expand Down
2 changes: 1 addition & 1 deletion addons/product/migrations/6.0.1.1/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##############################################################################

import pooler
from openupgrade import openupgrade
from openupgradelib import openupgrade

defaults_force = {
'product.category': [('type', 'normal')],
Expand Down
2 changes: 1 addition & 1 deletion addons/product/migrations/6.0.1.1/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##############################################################################

import logging
from openupgrade import openupgrade
from openupgradelib import openupgrade

logger = logging.getLogger('OpenUpgrade: product')

Expand Down
2 changes: 1 addition & 1 deletion addons/project/migrations/6.0.1.1/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##############################################################################

import pooler
from openupgrade import openupgrade
from openupgradelib import openupgrade

defaults = {
'project.project': [('sequence', 10)],
Expand Down
2 changes: 1 addition & 1 deletion addons/project/migrations/6.0.1.1/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##############################################################################

import logging
from openupgrade import openupgrade
from openupgradelib import openupgrade

logger = logging.getLogger('OpenUpgrade: project')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
##############################################################################

from openupgrade import openupgrade
from openupgradelib import openupgrade

def set_timesheet_id(cr):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
##############################################################################

from openupgrade import openupgrade
from openupgradelib import openupgrade

column_renames = {
'project_task_work': [
Expand Down
2 changes: 1 addition & 1 deletion addons/purchase/migrations/6.0.1.1/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##############################################################################

import pooler
from openupgrade import openupgrade
from openupgradelib import openupgrade

defaults_force = {
# False results in column value NULL
Expand Down
2 changes: 1 addition & 1 deletion addons/purchase/migrations/6.0.1.1/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
##############################################################################

from openupgrade import openupgrade
from openupgradelib import openupgrade

logger = logging.getLogger('OpenUpgrade: purchase')

Expand Down
2 changes: 1 addition & 1 deletion addons/sale/migrations/6.0.1.0/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##############################################################################

import pooler
from openupgrade import openupgrade
from openupgradelib import openupgrade

defaults_force = {
# False results in column value NULL
Expand Down
2 changes: 1 addition & 1 deletion addons/sale/migrations/6.0.1.0/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
##############################################################################

from openupgrade import openupgrade
from openupgradelib import openupgrade

column_renames = {
'sale_order': [
Expand Down
2 changes: 1 addition & 1 deletion addons/sale_journal/migrations/6.0.1.0/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##############################################################################

import pooler
from openupgrade import openupgrade
from openupgradelib import openupgrade

def migrate_picking_journal(cr, pool):
"""
Expand Down
2 changes: 1 addition & 1 deletion addons/sale_journal/migrations/6.0.1.0/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
##############################################################################

from openupgrade import openupgrade
from openupgradelib import openupgrade

column_renames = {
'stock_picking': [
Expand Down
2 changes: 1 addition & 1 deletion addons/stock/migrations/6.0.1.1/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##############################################################################

import pooler
from openupgrade import openupgrade
from openupgradelib import openupgrade

defaults_force = {
'stock.inventory': [('company_id', None)],
Expand Down
2 changes: 1 addition & 1 deletion addons/stock/migrations/6.0.1.1/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
##############################################################################

from openupgrade import openupgrade
from openupgradelib import openupgrade

renamed_columns = {
'stock_move': [
Expand Down
2 changes: 1 addition & 1 deletion bin/addons/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

logger = netsvc.Logger()

from openupgrade import openupgrade
from openupgradelib import openupgrade

_ad = os.path.abspath(opj(tools.ustr(tools.config['root_path']), u'addons')) # default addons path (base)
ad_paths= map(lambda m: os.path.abspath(tools.ustr(m.strip())), tools.config['addons_path'].split(','))
Expand Down
4 changes: 2 additions & 2 deletions bin/addons/base/migrations/6.0.1.3/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##############################################################################

import pooler, logging
from openupgrade import openupgrade
from openupgradelib import openupgrade
logger = logging.getLogger('OpenUpgrade: base')

obsolete_modules = [
Expand Down Expand Up @@ -302,7 +302,7 @@ def migrate(cr, version):
pool = pooler.get_pool(cr.dbname)
set_defaults_on_act_window(cr)
set_defaults_on_ir_attachment(cr)
openupgrade.set_defaults(cr, pool, defaults)
openupgrade.set_defaults(cr, pool, defaults, force=False, use_orm=True)
mgr_ir_rule(cr, pool)
mgr_res_partner_address(cr, pool)
mgr_res_partner(cr, pool)
Expand Down
2 changes: 1 addition & 1 deletion bin/addons/base/migrations/6.0.1.3/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# e.g. report_analytic_line (incorporated in hr_timesheet_invoice)

import pooler
from openupgrade import openupgrade
from openupgradelib import openupgrade

module_namespec = [
# This is a list of tuples (old module name, new module name)
Expand Down
2 changes: 0 additions & 2 deletions bin/addons/base/module/wizard/base_module_shortcut_data.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">

<record id="ir_ui_view_sc_configuration" model="ir.ui.view_sc">
<field name="name">Reconfigure</field>
<field name="resource">ir.ui.menu</field>
<field name="user_id" ref="base.user_root"/>
<field name="res_id" ref="menu_view_base_module_configuration"/>
</record>

</data>
</openerp>
2 changes: 0 additions & 2 deletions bin/addons/base/res/partner/partner_shortcut_data.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">

<record id="ir_ui_view_sc_partner0" model="ir.ui.view_sc">
<field name="name">Customers</field>
<field name="resource">ir.ui.menu</field>
<field name="user_id" ref="base.user_root"/>
<field name="res_id" ref="menu_partner_form"/>
</record>

</data>
</openerp>
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
try:
from openerp.openupgrade import openupgrade_tools
except ImportError:
from openupgrade import openupgrade_tools
from openupgradelib import openupgrade_tools

class generate_records_wizard(osv.osv_memory):
_name = 'openupgrade.generate.records.wizard'
Expand Down
2 changes: 1 addition & 1 deletion bin/openupgrade/openupgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
'short_name': _short_name,
}, DeprecationWarning, stacklevel=2)

_new_name = "openupgradelib.%s" % _short_name
_new_name = "openupgradelib.%s" % _short_name

_modules = __import__(_new_name, globals(), locals(), ['*'])
for _i in dir(_modules):
Expand Down
2 changes: 1 addition & 1 deletion bin/openupgrade/openupgrade_log.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from openupgrade_tools import table_exists
from openupgradelib.openupgrade_tools import table_exists

def log_xml_id(cr, module, xml_id):
"""
Expand Down

0 comments on commit 83614f5

Please sign in to comment.