Skip to content

[13.0] OpenUpgrade don't run base modules migration scripts #3830

@tonyctalope

Description

@tonyctalope

12 ➡️ 13:

Describe the bug

When I try to migrate from Odoo version 12.0 to version 13.0 using OpenUpgrade, only OCA migration scripts are executed, not the base module ones.

To Reproduce

Firstly I'm going to describe my environnement.

I am only using Docker for this purpose. I have already cloned the OpenUpgrade project using the command git clone -b 13.0 https://github.com/OCA/OpenUpgrade.git and added the OCA modules using the command git clone -b 13.0 https://github.com/OCA/<module_name>.git to it.
Additionally, I have cloned the 12.0 version of the OCA modules and placed them in the ./addons12/oca folder.
Dockerfile :

FROM odoo:13 as odoo13

USER root

RUN apt update \
    && apt install -y git \
    && pip3 install --upgrade pip \
    && pip3 install git+https://github.com/OCA/openupgradelib.git@master#egg=openupgradelib \
    && pip3 install polib

WORKDIR /etc/odoo/OpenUpgrade

docker-compose.yml :

version: '3.8'
services:
  upgrade13:
    build:
      context: .
      target: odoo13
    depends_on:
      - db
    volumes:
      - odoo-web-data:/var/lib/odoo
      - ./OpenUpgrade:/etc/odoo/OpenUpgrade
      - ./config/odoo_upgrade13.conf:/etc/odoo/odoo.conf
    command: ./odoo-bin -c /etc/odoo/odoo.conf -d odoo_migration -u all --stop-after-init

  web12:
    image: odoo:12
    depends_on:
      - db
    ports:
      - 8012:8069
    volumes:
      - odoo-web-data:/var/lib/odoo
      - ./config/odoo_web.conf:/etc/odoo/odoo.conf
      - ./addons12/oca:/mnt/extra-addons/oca

  db:
    image: postgres:12.2-alpine
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_PASSWORD=odoo
      - POSTGRES_USER=odoo
      - PGDATA=/var/lib/postgresql/data/pgdata
    volumes:
      - dbdata-odoo:/var/lib/postgresql/data

volumes:
  odoo-web-data:
  dbdata-odoo:

odoo_web.conf

[options]
db_host = db
db_user = odoo
db_password = odoo
admin_passwd = odoo
addons_path = /mnt/extra-addons/oca
log_db = False
log_db_level = warning
log_level  = debug
logfile = None
without_demo = all

odoo_upgrade13.conf

[options]
db_host = db
db_user = odoo
db_password = odoo
admin_passwd = odoo
data_dir = /var/lib/odoo/.local/share/Odoo
addons_path= /etc/odoo/OpenUpgrade/addons
log_db = False
log_db_level = warning
log_level  = debug
logfile = ./logging.log

Then, how I am going the actual migration

I launch the database using the command docker-compose up -d db. Then, I create a new database in Odoo 12.0 using the command docker-compose up web12, and install the account_asset_management module. After that, I add some basic data and close the Docker application. The database is named odoo_migration.

Now, I simply run the migration using the command docker-compose up upgrade13. Here is the log showing the loading of the account module:

DEBUG odoo_migration odoo.modules.loading: loading module account (29/35) 
INFO odoo_migration odoo.modules.registry: module account: creating or updating database tables 

.... A lot of table editions ....

INFO odoo_migration odoo.modules.loading: loading account/security/account_security.xml 
INFO odoo_migration odoo.modules.loading: loading account/security/ir.model.access.csv 
INFO odoo_migration odoo.modules.loading: loading account/data/data_account_type.xml 
INFO odoo_migration odoo.modules.loading: loading account/data/account_data.xml 
INFO odoo_migration odoo.modules.loading: loading account/data/digest_data.xml 
INFO odoo_migration odoo.modules.loading: loading account/views/account_menuitem.xml 
INFO odoo_migration odoo.modules.loading: loading account/views/account_payment_view.xml 
INFO odoo_migration odoo.modules.loading: loading account/wizard/account_accrual_accounting_view.xml 
INFO odoo_migration odoo.modules.loading: loading account/wizard/account_unreconcile_view.xml 
INFO odoo_migration odoo.modules.loading: loading account/wizard/account_move_reversal_view.xml 
INFO odoo_migration odoo.modules.loading: loading account/views/account_move_views.xml 
INFO odoo_migration odoo.modules.loading: loading account/wizard/setup_wizards_view.xml 
INFO odoo_migration odoo.modules.loading: loading account/wizard/pos_box.xml 
INFO odoo_migration odoo.modules.loading: loading account/views/partner_view.xml 
DEBUG odoo_migration odoo.tools.translate: translation went wrong for ""Element '%s' cannot be located in parent view"", skipped 
INFO odoo_migration odoo.addons.base.models.ir_ui_view: Element '<button name="toggle_active">' cannot be located in parent view

Error context:
View `partner.view.button.contracts_count`
[view_id: 539, xml_id: account.partner_view_button_contracts_count, model: res.partner, parent_id: 113] 
DEBUG odoo_migration odoo.tools.translate: translation went wrong for ""Element '%s' cannot be located in parent view"", skipped 
INFO odoo_migration odoo.addons.base.models.ir_ui_view: Element '<button name="toggle_active">' cannot be located in parent view

Error context:
View `partner.view.button.contracts_count`
[view_id: 539, xml_id: account.partner_view_button_contracts_count, model: res.partner, parent_id: 113] 
INFO odoo_migration odoo.modules.loading: loading account/views/account_view.xml 
INFO odoo_migration odoo.models.unlink: User #1 deleted ir.actions.act_window.view records with IDs: [22, 23, 24] 
INFO odoo_migration odoo.models.unlink: User #1 deleted ir.actions.act_window.view records with IDs: [25, 26, 27] 
INFO odoo_migration odoo.modules.loading: loading account/views/report_statement.xml 
INFO odoo_migration odoo.modules.loading: loading account/views/account_report.xml 
INFO odoo_migration odoo.modules.loading: loading account/data/mail_template_data.xml 
INFO odoo_migration odoo.modules.loading: loading account/wizard/account_validate_move_view.xml 
INFO odoo_migration odoo.modules.loading: loading account/views/account_end_fy.xml 
INFO odoo_migration odoo.modules.loading: loading account/views/product_view.xml 
INFO odoo_migration odoo.modules.loading: loading account/views/account_analytic_view.xml 
INFO odoo_migration odoo.modules.loading: loading account/views/account_tip_data.xml 
INFO odoo_migration odoo.modules.loading: loading account/views/account.xml 
INFO odoo_migration odoo.modules.loading: loading account/views/report_invoice.xml 
INFO odoo_migration odoo.modules.loading: loading account/report/account_invoice_report_view.xml 
INFO odoo_migration odoo.modules.loading: loading account/views/account_cash_rounding_view.xml 
INFO odoo_migration odoo.modules.loading: loading account/wizard/account_report_common_view.xml 
INFO odoo_migration odoo.modules.loading: loading account/views/report_journal.xml 
INFO odoo_migration odoo.modules.loading: loading account/views/tax_adjustments.xml 
INFO odoo_migration odoo.modules.loading: loading account/wizard/wizard_tax_adjustments_view.xml 
INFO odoo_migration odoo.modules.loading: loading account/views/res_config_settings_views.xml 
INFO odoo_migration odoo.modules.loading: loading account/views/account_journal_dashboard_view.xml 
INFO odoo_migration odoo.modules.loading: loading account/views/account_portal_templates.xml 
INFO odoo_migration odoo.modules.loading: loading account/views/report_payment_receipt_templates.xml 
INFO odoo_migration odoo.modules.loading: loading account/data/payment_receipt_data.xml 
INFO odoo_migration odoo.modules.loading: loading account/views/account_onboarding_templates.xml 
INFO odoo_migration odoo.modules.loading: loading account/data/service_cron.xml 
INFO odoo_migration odoo.modules.loading: loading account/views/account_fiscal_year_view.xml 
INFO odoo_migration odoo.modules.loading: loading account/views/account_incoterms_view.xml 
INFO odoo_migration odoo.modules.loading: loading account/data/account_incoterms_data.xml 
INFO odoo_migration odoo.modules.loading: loading account/views/digest_views.xml 
INFO odoo_migration odoo.modules.loading: loading account/wizard/account_invoice_send_views.xml 
INFO odoo_migration odoo.modules.loading: loading account/views/account_tax_report_views.xml 
INFO odoo_migration odoo.modules.loading: loading account/views/report_statement.xml 
INFO odoo_migration odoo.modules.loading: loading account/report/account_hash_integrity_templates.xml

And some log of the account_asset_management module :

INFO odoo_migration odoo.modules.migration: module account_asset_management: Running migration [13.0.1.0.0>] post-migration 
INFO odoo_migration OpenUpgrade: account_asset_management: post-migration script called with version 12.0.3.2.0 

(Moreover, I got the migration scripts for the base module : INFO odoo_migration odoo.modules.migration: module base: Running migration [>13.0.1.3] pre-migration)

Expected behavior
As you can see, the migration scripts of the OCA module are working, but not for the base module. I was expecting a log line similar to this: INFO odoo_migration odoo.modules.migration: module account: Running migration [13.0.1.1.0>] post-migration .

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions