From da0ed25615bb196b05cbd2ddb092f74a6f5144ac Mon Sep 17 00:00:00 2001 From: Mikel Date: Tue, 22 Mar 2016 18:35:04 +0100 Subject: [PATCH 1/4] [FIX] Warings about using openupgradelib --- addons/account/migrations/6.0.1.1/post-migration.py | 2 +- addons/account/migrations/6.0.1.1/pre-migration.py | 2 +- addons/account_budget/migrations/6.0.1.0/post-migration.py | 2 +- addons/account_payment/migrations/6.0.1.1/post-migration.py | 2 +- addons/account_payment/migrations/6.0.1.1/pre-migration.py | 2 +- .../base_report_creator/migrations/6.0.1.0/pre-migration.py | 2 +- addons/hr/migrations/6.0.1.1/post-migration.py | 2 +- addons/hr/migrations/6.0.1.1/pre-migration.py | 2 +- addons/hr_contract/migrations/6.0.1.0/post-migration.py | 2 +- addons/hr_contract/migrations/6.0.1.0/pre-migration.py | 2 +- addons/hr_expense/migrations/6.0.1.0/post-migration.py | 2 +- .../hr_timesheet_sheet/migrations/6.0.1.0/post-migration.py | 2 +- .../hr_timesheet_sheet/migrations/6.0.1.0/pre-migration.py | 2 +- addons/membership/migrations/6.0.0.1/post-migration.py | 2 +- addons/mrp/migrations/6.0.1.1/post-migration.py | 2 +- addons/mrp/migrations/6.0.1.1/pre-migration.py | 2 +- addons/procurement/migrations/6.0.1.0/post-migration.py | 2 +- addons/procurement/migrations/6.0.1.0/pre-migration.py | 2 +- addons/product/migrations/6.0.1.1/post-migration.py | 2 +- addons/product/migrations/6.0.1.1/pre-migration.py | 2 +- addons/product/product.py | 5 ++++- addons/project/migrations/6.0.1.1/post-migration.py | 2 +- addons/project/migrations/6.0.1.1/pre-migration.py | 2 +- .../project_timesheet/migrations/6.0.1.0/post-migration.py | 2 +- addons/project_timesheet/migrations/6.0.1.0/pre-migration.py | 2 +- addons/purchase/migrations/6.0.1.1/post-migration.py | 2 +- addons/purchase/migrations/6.0.1.1/pre-migration.py | 2 +- addons/sale/migrations/6.0.1.0/post-migration.py | 2 +- addons/sale/migrations/6.0.1.0/pre-migration.py | 2 +- addons/sale_journal/migrations/6.0.1.0/post-migration.py | 2 +- addons/sale_journal/migrations/6.0.1.0/pre-migration.py | 2 +- addons/stock/migrations/6.0.1.1/post-migration.py | 2 +- addons/stock/migrations/6.0.1.1/pre-migration.py | 2 +- bin/addons/__init__.py | 2 +- bin/addons/base/migrations/6.0.1.3/post-migration.py | 4 ++-- bin/addons/base/migrations/6.0.1.3/pre-migration.py | 2 +- bin/addons/base/module/wizard/base_module_shortcut_data.xml | 2 -- bin/addons/base/res/partner/partner_shortcut_data.xml | 2 -- .../openupgrade_records/model/generate_records_wizard.py | 2 +- bin/openupgrade/openupgrade.py | 2 +- bin/openupgrade/openupgrade_log.py | 3 ++- 41 files changed, 44 insertions(+), 44 deletions(-) diff --git a/addons/account/migrations/6.0.1.1/post-migration.py b/addons/account/migrations/6.0.1.1/post-migration.py index 3249c319112d..09ed2800225c 100644 --- a/addons/account/migrations/6.0.1.1/post-migration.py +++ b/addons/account/migrations/6.0.1.1/post-migration.py @@ -20,7 +20,7 @@ ############################################################################## import pooler -from openupgrade import openupgrade +from openupgradelib import openupgrade defaults = { # False results in column value NULL diff --git a/addons/account/migrations/6.0.1.1/pre-migration.py b/addons/account/migrations/6.0.1.1/pre-migration.py index e32de2e33764..ef359519b4b6 100644 --- a/addons/account/migrations/6.0.1.1/pre-migration.py +++ b/addons/account/migrations/6.0.1.1/pre-migration.py @@ -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 diff --git a/addons/account_budget/migrations/6.0.1.0/post-migration.py b/addons/account_budget/migrations/6.0.1.0/post-migration.py index facc5ed230b4..14a761d12714 100644 --- a/addons/account_budget/migrations/6.0.1.0/post-migration.py +++ b/addons/account_budget/migrations/6.0.1.0/post-migration.py @@ -20,7 +20,7 @@ ############################################################################## import pooler -from openupgrade import openupgrade +from openupgradelib import openupgrade MODULE='account_budget' diff --git a/addons/account_payment/migrations/6.0.1.1/post-migration.py b/addons/account_payment/migrations/6.0.1.1/post-migration.py index c185b4d5acce..9c6436a15b2b 100644 --- a/addons/account_payment/migrations/6.0.1.1/post-migration.py +++ b/addons/account_payment/migrations/6.0.1.1/post-migration.py @@ -20,7 +20,7 @@ ############################################################################## import pooler -from openupgrade import openupgrade +from openupgradelib import openupgrade defaults_force = { # False results in column value NULL diff --git a/addons/account_payment/migrations/6.0.1.1/pre-migration.py b/addons/account_payment/migrations/6.0.1.1/pre-migration.py index 910986b82b95..1f4e5bcefd44 100644 --- a/addons/account_payment/migrations/6.0.1.1/pre-migration.py +++ b/addons/account_payment/migrations/6.0.1.1/pre-migration.py @@ -19,7 +19,7 @@ # ############################################################################## -from openupgrade import openupgrade +from openupgradelib import openupgrade column_renames = { # this is a mapping per table from old column name diff --git a/addons/base_report_creator/migrations/6.0.1.0/pre-migration.py b/addons/base_report_creator/migrations/6.0.1.0/pre-migration.py index 2198aa53f7ca..4032d6717bf4 100644 --- a/addons/base_report_creator/migrations/6.0.1.0/pre-migration.py +++ b/addons/base_report_creator/migrations/6.0.1.0/pre-migration.py @@ -19,7 +19,7 @@ # ############################################################################## -from openupgrade import openupgrade +from openupgradelib import openupgrade @openupgrade.migrate() def migrate(cr, version): diff --git a/addons/hr/migrations/6.0.1.1/post-migration.py b/addons/hr/migrations/6.0.1.1/post-migration.py index 7313df7ae794..dabce8342c26 100644 --- a/addons/hr/migrations/6.0.1.1/post-migration.py +++ b/addons/hr/migrations/6.0.1.1/post-migration.py @@ -20,7 +20,7 @@ ############################################################################## import pooler, logging -from openupgrade import openupgrade +from openupgradelib import openupgrade logger = logging.getLogger('OpenUpgrade: hr') diff --git a/addons/hr/migrations/6.0.1.1/pre-migration.py b/addons/hr/migrations/6.0.1.1/pre-migration.py index 31801d8b4393..6af9f511d829 100644 --- a/addons/hr/migrations/6.0.1.1/pre-migration.py +++ b/addons/hr/migrations/6.0.1.1/pre-migration.py @@ -19,7 +19,7 @@ # ############################################################################## -from openupgrade import openupgrade +from openupgradelib import openupgrade column_renames = { # this is a mapping per table from old column name diff --git a/addons/hr_contract/migrations/6.0.1.0/post-migration.py b/addons/hr_contract/migrations/6.0.1.0/post-migration.py index c18f1ec1defa..b4303b751d4d 100644 --- a/addons/hr_contract/migrations/6.0.1.0/post-migration.py +++ b/addons/hr_contract/migrations/6.0.1.0/post-migration.py @@ -20,7 +20,7 @@ ############################################################################## import pooler, logging -from openupgrade import openupgrade +from openupgradelib import openupgrade logger = logging.getLogger('migrate') MODULE = 'hr_contract' diff --git a/addons/hr_contract/migrations/6.0.1.0/pre-migration.py b/addons/hr_contract/migrations/6.0.1.0/pre-migration.py index 7bd294580f05..f589d2d61ae7 100644 --- a/addons/hr_contract/migrations/6.0.1.0/pre-migration.py +++ b/addons/hr_contract/migrations/6.0.1.0/pre-migration.py @@ -19,7 +19,7 @@ # ############################################################################## -from openupgrade import openupgrade +from openupgradelib import openupgrade column_renames = { # this is a mapping per table from old column name diff --git a/addons/hr_expense/migrations/6.0.1.0/post-migration.py b/addons/hr_expense/migrations/6.0.1.0/post-migration.py index 701af814e22b..6c898cbdc174 100644 --- a/addons/hr_expense/migrations/6.0.1.0/post-migration.py +++ b/addons/hr_expense/migrations/6.0.1.0/post-migration.py @@ -20,7 +20,7 @@ ############################################################################## import pooler -from openupgrade import openupgrade +from openupgradelib import openupgrade defaults_force = { 'hr.expense.expense': [ diff --git a/addons/hr_timesheet_sheet/migrations/6.0.1.0/post-migration.py b/addons/hr_timesheet_sheet/migrations/6.0.1.0/post-migration.py index 4bd02f78b6aa..3053e6fda741 100644 --- a/addons/hr_timesheet_sheet/migrations/6.0.1.0/post-migration.py +++ b/addons/hr_timesheet_sheet/migrations/6.0.1.0/post-migration.py @@ -20,7 +20,7 @@ ############################################################################## import pooler -from openupgrade import openupgrade +from openupgradelib import openupgrade defaults_force = { 'hr_timesheet_sheet.sheet': diff --git a/addons/hr_timesheet_sheet/migrations/6.0.1.0/pre-migration.py b/addons/hr_timesheet_sheet/migrations/6.0.1.0/pre-migration.py index 3b9829390858..744753d0ed8e 100644 --- a/addons/hr_timesheet_sheet/migrations/6.0.1.0/pre-migration.py +++ b/addons/hr_timesheet_sheet/migrations/6.0.1.0/pre-migration.py @@ -19,7 +19,7 @@ # ############################################################################## -from openupgrade import openupgrade +from openupgradelib import openupgrade column_renames = { # this is a mapping per table from old column name diff --git a/addons/membership/migrations/6.0.0.1/post-migration.py b/addons/membership/migrations/6.0.0.1/post-migration.py index eb0f49e3523c..12e732c8ad7a 100644 --- a/addons/membership/migrations/6.0.0.1/post-migration.py +++ b/addons/membership/migrations/6.0.0.1/post-migration.py @@ -19,7 +19,7 @@ # ############################################################################## -from openupgrade import openupgrade +from openupgradelib import openupgrade @openupgrade.migrate() def migrate(cr, version): diff --git a/addons/mrp/migrations/6.0.1.1/post-migration.py b/addons/mrp/migrations/6.0.1.1/post-migration.py index 07716d28e286..4f0d5c628d47 100644 --- a/addons/mrp/migrations/6.0.1.1/post-migration.py +++ b/addons/mrp/migrations/6.0.1.1/post-migration.py @@ -20,7 +20,7 @@ ############################################################################## import pooler -from openupgrade import openupgrade +from openupgradelib import openupgrade defaults_force = { 'mrp.bom': [('company_id', None)], diff --git a/addons/mrp/migrations/6.0.1.1/pre-migration.py b/addons/mrp/migrations/6.0.1.1/pre-migration.py index eef085836c61..32b00509cf4d 100644 --- a/addons/mrp/migrations/6.0.1.1/pre-migration.py +++ b/addons/mrp/migrations/6.0.1.1/pre-migration.py @@ -19,7 +19,7 @@ # ############################################################################## -from openupgrade import openupgrade +from openupgradelib import openupgrade column_renames = { 'mrp_production': [ diff --git a/addons/procurement/migrations/6.0.1.0/post-migration.py b/addons/procurement/migrations/6.0.1.0/post-migration.py index 0cbe9f74b46c..4a21bce56003 100644 --- a/addons/procurement/migrations/6.0.1.0/post-migration.py +++ b/addons/procurement/migrations/6.0.1.0/post-migration.py @@ -20,7 +20,7 @@ ############################################################################## import pooler -from openupgrade import openupgrade +from openupgradelib import openupgrade defaults_force = { 'procurement.order': [('company_id', None)], diff --git a/addons/procurement/migrations/6.0.1.0/pre-migration.py b/addons/procurement/migrations/6.0.1.0/pre-migration.py index 4f886b49cb7f..29cb5c8e92d3 100644 --- a/addons/procurement/migrations/6.0.1.0/pre-migration.py +++ b/addons/procurement/migrations/6.0.1.0/pre-migration.py @@ -20,7 +20,7 @@ ############################################################################## import logging -from openupgrade import openupgrade +from openupgradelib import openupgrade logger = logging.getLogger('OpenUpgrade: procurement') diff --git a/addons/product/migrations/6.0.1.1/post-migration.py b/addons/product/migrations/6.0.1.1/post-migration.py index 825f26bd5f1d..1629f0438f7e 100644 --- a/addons/product/migrations/6.0.1.1/post-migration.py +++ b/addons/product/migrations/6.0.1.1/post-migration.py @@ -20,7 +20,7 @@ ############################################################################## import pooler -from openupgrade import openupgrade +from openupgradelib import openupgrade defaults_force = { 'product.category': [('type', 'normal')], diff --git a/addons/product/migrations/6.0.1.1/pre-migration.py b/addons/product/migrations/6.0.1.1/pre-migration.py index 1d44c0600644..74792b516316 100644 --- a/addons/product/migrations/6.0.1.1/pre-migration.py +++ b/addons/product/migrations/6.0.1.1/pre-migration.py @@ -20,7 +20,7 @@ ############################################################################## import logging -from openupgrade import openupgrade +from openupgradelib import openupgrade logger = logging.getLogger('OpenUpgrade: product') diff --git a/addons/product/product.py b/addons/product/product.py index 1d5b0832997e..7882cce07e22 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -746,7 +746,10 @@ def _get_uom_id(self, cr, uid, *args): def _check_uom(self, cr, uid, ids, context=None): for supplier_info in self.browse(cr, uid, ids, context=context): if supplier_info.product_uom and supplier_info.product_uom.category_id.id <> supplier_info.product_id.uom_id.category_id.id: - return False + cr.execute('select uom_id from product_template where id = %s',(supplier_info.product_id.id,)) + res = cr.fetchone() + cr.execute('update product_supplierinfo set product_uom = %s where product_id = %s ',(res[0],supplier_info.product_id.id,)) + return True return True _constraints = [ diff --git a/addons/project/migrations/6.0.1.1/post-migration.py b/addons/project/migrations/6.0.1.1/post-migration.py index 65cfbed57ef1..c462a714d8c7 100644 --- a/addons/project/migrations/6.0.1.1/post-migration.py +++ b/addons/project/migrations/6.0.1.1/post-migration.py @@ -20,7 +20,7 @@ ############################################################################## import pooler -from openupgrade import openupgrade +from openupgradelib import openupgrade defaults = { 'project.project': [('sequence', 10)], diff --git a/addons/project/migrations/6.0.1.1/pre-migration.py b/addons/project/migrations/6.0.1.1/pre-migration.py index 3d8a4026f326..4365a5929511 100644 --- a/addons/project/migrations/6.0.1.1/pre-migration.py +++ b/addons/project/migrations/6.0.1.1/pre-migration.py @@ -20,7 +20,7 @@ ############################################################################## import logging -from openupgrade import openupgrade +from openupgradelib import openupgrade logger = logging.getLogger('OpenUpgrade: project') diff --git a/addons/project_timesheet/migrations/6.0.1.0/post-migration.py b/addons/project_timesheet/migrations/6.0.1.0/post-migration.py index fb898e2e502d..fd1f1dd9cbc0 100644 --- a/addons/project_timesheet/migrations/6.0.1.0/post-migration.py +++ b/addons/project_timesheet/migrations/6.0.1.0/post-migration.py @@ -19,7 +19,7 @@ # ############################################################################## -from openupgrade import openupgrade +from openupgradelib import openupgrade def set_timesheet_id(cr): """ diff --git a/addons/project_timesheet/migrations/6.0.1.0/pre-migration.py b/addons/project_timesheet/migrations/6.0.1.0/pre-migration.py index 40631ffec41b..767f48e01e43 100644 --- a/addons/project_timesheet/migrations/6.0.1.0/pre-migration.py +++ b/addons/project_timesheet/migrations/6.0.1.0/pre-migration.py @@ -19,7 +19,7 @@ # ############################################################################## -from openupgrade import openupgrade +from openupgradelib import openupgrade column_renames = { 'project_task_work': [ diff --git a/addons/purchase/migrations/6.0.1.1/post-migration.py b/addons/purchase/migrations/6.0.1.1/post-migration.py index 59abf7cb6615..0f9050c27962 100644 --- a/addons/purchase/migrations/6.0.1.1/post-migration.py +++ b/addons/purchase/migrations/6.0.1.1/post-migration.py @@ -20,7 +20,7 @@ ############################################################################## import pooler -from openupgrade import openupgrade +from openupgradelib import openupgrade defaults_force = { # False results in column value NULL diff --git a/addons/purchase/migrations/6.0.1.1/pre-migration.py b/addons/purchase/migrations/6.0.1.1/pre-migration.py index 910c27266002..31d71ec9bfe2 100644 --- a/addons/purchase/migrations/6.0.1.1/pre-migration.py +++ b/addons/purchase/migrations/6.0.1.1/pre-migration.py @@ -19,7 +19,7 @@ # ############################################################################## -from openupgrade import openupgrade +from openupgradelib import openupgrade logger = logging.getLogger('OpenUpgrade: purchase') diff --git a/addons/sale/migrations/6.0.1.0/post-migration.py b/addons/sale/migrations/6.0.1.0/post-migration.py index b777fcb716de..160afc760fcd 100644 --- a/addons/sale/migrations/6.0.1.0/post-migration.py +++ b/addons/sale/migrations/6.0.1.0/post-migration.py @@ -20,7 +20,7 @@ ############################################################################## import pooler -from openupgrade import openupgrade +from openupgradelib import openupgrade defaults_force = { # False results in column value NULL diff --git a/addons/sale/migrations/6.0.1.0/pre-migration.py b/addons/sale/migrations/6.0.1.0/pre-migration.py index 78fcfc78c29c..93b523cded08 100644 --- a/addons/sale/migrations/6.0.1.0/pre-migration.py +++ b/addons/sale/migrations/6.0.1.0/pre-migration.py @@ -19,7 +19,7 @@ # ############################################################################## -from openupgrade import openupgrade +from openupgradelib import openupgrade column_renames = { 'sale_order': [ diff --git a/addons/sale_journal/migrations/6.0.1.0/post-migration.py b/addons/sale_journal/migrations/6.0.1.0/post-migration.py index 2110be76e47f..69295618b751 100644 --- a/addons/sale_journal/migrations/6.0.1.0/post-migration.py +++ b/addons/sale_journal/migrations/6.0.1.0/post-migration.py @@ -20,7 +20,7 @@ ############################################################################## import pooler -from openupgrade import openupgrade +from openupgradelib import openupgrade def migrate_picking_journal(cr, pool): """ diff --git a/addons/sale_journal/migrations/6.0.1.0/pre-migration.py b/addons/sale_journal/migrations/6.0.1.0/pre-migration.py index f653098d81cc..583534505420 100644 --- a/addons/sale_journal/migrations/6.0.1.0/pre-migration.py +++ b/addons/sale_journal/migrations/6.0.1.0/pre-migration.py @@ -19,7 +19,7 @@ # ############################################################################## -from openupgrade import openupgrade +from openupgradelib import openupgrade column_renames = { 'stock_picking': [ diff --git a/addons/stock/migrations/6.0.1.1/post-migration.py b/addons/stock/migrations/6.0.1.1/post-migration.py index d68e45a2c7d1..92224d5cd5a0 100644 --- a/addons/stock/migrations/6.0.1.1/post-migration.py +++ b/addons/stock/migrations/6.0.1.1/post-migration.py @@ -20,7 +20,7 @@ ############################################################################## import pooler -from openupgrade import openupgrade +from openupgradelib import openupgrade defaults_force = { 'stock.inventory': [('company_id', None)], diff --git a/addons/stock/migrations/6.0.1.1/pre-migration.py b/addons/stock/migrations/6.0.1.1/pre-migration.py index a8a3e3bc0de3..f41570473951 100644 --- a/addons/stock/migrations/6.0.1.1/pre-migration.py +++ b/addons/stock/migrations/6.0.1.1/pre-migration.py @@ -19,7 +19,7 @@ # ############################################################################## -from openupgrade import openupgrade +from openupgradelib import openupgrade renamed_columns = { 'stock_move': [ diff --git a/bin/addons/__init__.py b/bin/addons/__init__.py index c3dccbbaf51c..face9a3403cd 100644 --- a/bin/addons/__init__.py +++ b/bin/addons/__init__.py @@ -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(',')) diff --git a/bin/addons/base/migrations/6.0.1.3/post-migration.py b/bin/addons/base/migrations/6.0.1.3/post-migration.py index 13456ade47a8..612882ce181a 100644 --- a/bin/addons/base/migrations/6.0.1.3/post-migration.py +++ b/bin/addons/base/migrations/6.0.1.3/post-migration.py @@ -20,7 +20,7 @@ ############################################################################## import pooler, logging -from openupgrade import openupgrade +from openupgradelib import openupgrade logger = logging.getLogger('OpenUpgrade: base') obsolete_modules = [ @@ -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,False,True) mgr_ir_rule(cr, pool) mgr_res_partner_address(cr, pool) mgr_res_partner(cr, pool) diff --git a/bin/addons/base/migrations/6.0.1.3/pre-migration.py b/bin/addons/base/migrations/6.0.1.3/pre-migration.py index ffa129d3d1f0..12b8c176fc4c 100644 --- a/bin/addons/base/migrations/6.0.1.3/pre-migration.py +++ b/bin/addons/base/migrations/6.0.1.3/pre-migration.py @@ -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) diff --git a/bin/addons/base/module/wizard/base_module_shortcut_data.xml b/bin/addons/base/module/wizard/base_module_shortcut_data.xml index e5faaabdd5e8..87545eb68a6c 100644 --- a/bin/addons/base/module/wizard/base_module_shortcut_data.xml +++ b/bin/addons/base/module/wizard/base_module_shortcut_data.xml @@ -1,13 +1,11 @@ - Reconfigure ir.ui.menu - diff --git a/bin/addons/base/res/partner/partner_shortcut_data.xml b/bin/addons/base/res/partner/partner_shortcut_data.xml index ee534a2ff6b2..8aefaedc6ad9 100644 --- a/bin/addons/base/res/partner/partner_shortcut_data.xml +++ b/bin/addons/base/res/partner/partner_shortcut_data.xml @@ -1,13 +1,11 @@ - Customers ir.ui.menu - diff --git a/bin/addons/openupgrade_records/model/generate_records_wizard.py b/bin/addons/openupgrade_records/model/generate_records_wizard.py index 689fdd69478e..ec366cd9845c 100644 --- a/bin/addons/openupgrade_records/model/generate_records_wizard.py +++ b/bin/addons/openupgrade_records/model/generate_records_wizard.py @@ -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' diff --git a/bin/openupgrade/openupgrade.py b/bin/openupgrade/openupgrade.py index 6cc2a4c53aa0..a9c9770b900b 100644 --- a/bin/openupgrade/openupgrade.py +++ b/bin/openupgrade/openupgrade.py @@ -32,4 +32,4 @@ _modules = __import__(_new_name, globals(), locals(), ['*']) for _i in dir(_modules): - locals()[_i] = getattr(_modules, _i) + locals()[_i] = getattr(_modules, _i) \ No newline at end of file diff --git a/bin/openupgrade/openupgrade_log.py b/bin/openupgrade/openupgrade_log.py index 40156564bd23..8d8f53011355 100644 --- a/bin/openupgrade/openupgrade_log.py +++ b/bin/openupgrade/openupgrade_log.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- -from openupgrade_tools import table_exists +from openupgradelib import openupgrade_tools +from openupgradelib.openupgrade_tools import table_exists def log_xml_id(cr, module, xml_id): """ From c821cc68c7615ada8fa1e41c68104af6674e9941 Mon Sep 17 00:00:00 2001 From: Mikel Date: Tue, 22 Mar 2016 19:53:12 +0100 Subject: [PATCH 2/4] [IMP] pep8 spacing --- bin/addons/base/migrations/6.0.1.3/post-migration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/addons/base/migrations/6.0.1.3/post-migration.py b/bin/addons/base/migrations/6.0.1.3/post-migration.py index 612882ce181a..9087f3830764 100644 --- a/bin/addons/base/migrations/6.0.1.3/post-migration.py +++ b/bin/addons/base/migrations/6.0.1.3/post-migration.py @@ -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,False,True) + 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) From 3376ac2cb939e6289ffa02c155f4cfb24deb06ab Mon Sep 17 00:00:00 2001 From: Mikel Date: Wed, 23 Mar 2016 09:28:53 +0100 Subject: [PATCH 3/4] [IMP] Remove unrelated changes --- addons/product/product.py | 5 +---- bin/openupgrade/openupgrade_log.py | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/addons/product/product.py b/addons/product/product.py index 7882cce07e22..1d5b0832997e 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -746,10 +746,7 @@ def _get_uom_id(self, cr, uid, *args): def _check_uom(self, cr, uid, ids, context=None): for supplier_info in self.browse(cr, uid, ids, context=context): if supplier_info.product_uom and supplier_info.product_uom.category_id.id <> supplier_info.product_id.uom_id.category_id.id: - cr.execute('select uom_id from product_template where id = %s',(supplier_info.product_id.id,)) - res = cr.fetchone() - cr.execute('update product_supplierinfo set product_uom = %s where product_id = %s ',(res[0],supplier_info.product_id.id,)) - return True + return False return True _constraints = [ diff --git a/bin/openupgrade/openupgrade_log.py b/bin/openupgrade/openupgrade_log.py index 8d8f53011355..93c94b6a00d1 100644 --- a/bin/openupgrade/openupgrade_log.py +++ b/bin/openupgrade/openupgrade_log.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from openupgradelib import openupgrade_tools from openupgradelib.openupgrade_tools import table_exists def log_xml_id(cr, module, xml_id): From c17db944737d419585a10cd08a6cb89cad909379 Mon Sep 17 00:00:00 2001 From: Mikel Martin Date: Sat, 2 Apr 2016 12:01:46 +0200 Subject: [PATCH 4/4] [FIX] Restore accidentally deleted new line --- bin/openupgrade/openupgrade.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/openupgrade/openupgrade.py b/bin/openupgrade/openupgrade.py index a9c9770b900b..fd4baaa8daab 100644 --- a/bin/openupgrade/openupgrade.py +++ b/bin/openupgrade/openupgrade.py @@ -28,8 +28,8 @@ '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): - locals()[_i] = getattr(_modules, _i) \ No newline at end of file + locals()[_i] = getattr(_modules, _i)