Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: only run migration on DB's migrating from v6.1 #281

Merged
merged 2 commits into from Sep 11, 2016

Conversation

JosDeGraeve
Copy link

Upgrading from v7.0 to v8.0 fails because the table account_voucher_sale_order_rel does not exist.
The v8.0 db was migrated by odoo from v7 -> v8

producing this stack trace:

2016-03-17 17:45:35,174 14774 INFO mooddesign8 openerp.modules.migration: module sale_payment_method: Running migration [0.1>] sale.order:: V7 change/rename the field payment_id into amany2many with the name payment_ids
2016-03-17 17:45:35,174 14774 ERROR mooddesign8 openerp.sql_db: Programming error: relation "account_voucher_sale_order_rel" does not exist
LINE 1: INSERT INTO account_voucher_sale_order_rel(sale_order_id, ac...
                    ^
, in query INSERT INTO account_voucher_sale_order_rel(sale_order_id, account_voucher_id) (SELECT id, payment_id FROM  sale_order WHERE payment_id IS NOT NULL )
2016-03-17 17:45:35,174 14774 CRITICAL mooddesign8 openerp.service.server: Failed to initialize database `mooddesign8`.
Traceback (most recent call last):
  File "/opt/odoo/8.0/odoo/openerp/service/server.py", line 929, in preload_registries
    registry = RegistryManager.new(dbname, update_module=update_module)
  File "/opt/odoo/8.0/odoo/openerp/modules/registry.py", line 370, in new
    openerp.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/opt/odoo/8.0/odoo/openerp/modules/loading.py", line 351, in load_modules
    force, status, report, loaded_modules, update_module)
  File "/opt/odoo/8.0/odoo/openerp/modules/loading.py", line 255, in load_marked_modules
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
  File "/opt/odoo/8.0/odoo/openerp/modules/loading.py", line 183, in load_module_graph
    migrations.migrate_module(package, 'post')
  File "/opt/odoo/8.0/odoo/openerp/modules/migration.py", line 171, in migrate_module
    migrate(self.cr, pkg.installed_version)
  File "/opt/odoo/8.0/addons-enabled/sale_payment_method/migrations/0.1/post-migration.py", line 32, in migrate
    cr.execute("INSERT INTO account_voucher_sale_order_rel"
  File "/opt/odoo/8.0/odoo/openerp/sql_db.py", line 158, in wrapper
    return f(self, *args, **kwargs)
  File "/opt/odoo/8.0/odoo/openerp/sql_db.py", line 234, in execute
    res = self._obj.execute(query, params)
ProgrammingError: relation "account_voucher_sale_order_rel" does not exist
LINE 1: INSERT INTO account_voucher_sale_order_rel(sale_order_id, ac...
                    ^

@pedrobaeza
Copy link
Member

If this script is also present on 7.0 branch, here you should remove it, as you mustn't put the script in 2 major versions

@StefanRijnhart
Copy link
Member

Agreed with @pedrobaeza, you can remove the script in the 8.0 branch.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) to 73.832% when pulling d6957f6 on apertoso:8.0-fix_postmigration into e439f5c on OCA:8.0.

@pedrobaeza
Copy link
Member

👍

@n1b0r
Copy link

n1b0r commented Sep 10, 2016

👍 The post-migration script break the migration process from 7.0 to 8.0. This PR resolve the issue

@StefanRijnhart StefanRijnhart merged commit b0a1e2b into OCA:8.0 Sep 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants