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

[13.0][MIG] utm #2258

Merged
merged 1 commit into from
Apr 4, 2020
Merged

[13.0][MIG] utm #2258

merged 1 commit into from
Apr 4, 2020

Conversation

MiquelRForgeFlow
Copy link
Contributor

Migration scripts of utm.

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@MiquelRForgeFlow MiquelRForgeFlow added this to the 13.0 milestone Mar 27, 2020
@MiquelRForgeFlow MiquelRForgeFlow changed the title [MIG] utm [13.0][MIG] utm Mar 27, 2020
@kos94ok-3D
Copy link

kos94ok-3D commented Mar 27, 2020

I think need to merge mail.mass_mailing.campaign and utm.campaign models
odoo/odoo@a661b00

@MiquelRForgeFlow MiquelRForgeFlow force-pushed the 13.0-mig-utm-scripts branch 2 times, most recently from a2071c9 to 373ec61 Compare March 27, 2020 18:42
@MiquelRForgeFlow
Copy link
Contributor Author

Thanks @kos94ok-3D , it slipped my mind.

@MiquelRForgeFlow
Copy link
Contributor Author

MiquelRForgeFlow commented Mar 30, 2020

Yes, in v12, mail.mass_mailing.campaign has _inherits = {'utm.campaign': 'campaign_id'}

@pedrobaeza
Copy link
Member

Then the code should be more sophisticated (I will check any way this later).

@MiquelRForgeFlow
Copy link
Contributor Author

yeah, I am working on it

@MiquelRForgeFlow MiquelRForgeFlow force-pushed the 13.0-mig-utm-scripts branch 2 times, most recently from d0c7739 to 5c5e738 Compare March 30, 2020 10:12
@MiquelRForgeFlow
Copy link
Contributor Author

It's ready. @kos94ok-3D could you review again? :)

@kos94ok-3D
Copy link

Looks good. Just code review.

@pedrobaeza pedrobaeza merged commit b190155 into OCA:13.0 Apr 4, 2020
@pedrobaeza pedrobaeza deleted the 13.0-mig-utm-scripts branch April 4, 2020 14:57
@AaronHForgeFlow
Copy link

utm does not depend on mass_mailing so scripts fail when mass_mailing is not installed previously 😱

@pedrobaeza
Copy link
Member

It shouldn't. Please put the stack trace that supports your affirmation.

@AaronHForgeFlow
Copy link

AaronHForgeFlow commented Aug 3, 2020

This is the stack trace:

2020-08-03 13:47:19,864 7982 INFO database odoo.modules.migration: module utm: Running migration [>13.0.1.0] pre-migration 
2020-08-03 13:47:20,138 7982 INFO database OpenUpgrade: utm: pre-migration script called with version 12.0.1.0 
2020-08-03 13:47:20,459 7982 INFO database odoo.modules.registry: module utm: creating or updating database tables 
2020-08-03 13:47:20,476 7982 ERROR database odoo.sql_db: bad query: SELECT "utm_stage".id FROM "utm_stage" ORDER BY "utm_stage"."sequence"   limit 1
ERROR: relation "utm_stage" does not exist
LINE 1: SELECT "utm_stage".id FROM "utm_stage" ORDER BY "utm_stage"....

The renames for model, table and xmlid are not executed (that is correct), but then it fails when upgrading the module. It is weird because it tries to read a table before creating it. I will update this comment with my findings.

@pedrobaeza
Copy link
Member

It shouldn't fail, as Odoo will create the table for you in most cases.

@AaronHForgeFlow
Copy link

AaronHForgeFlow commented Aug 3, 2020

I think the problem is Odoo defines a relation to utm_stage https://github.com/odoo/odoo/blob/13.0/addons/utm/models/utm.py#L27 before defining the model https://github.com/odoo/odoo/blob/13.0/addons/utm/models/utm.py#L51 so no issue with Openupgrade

Edited: Confirmed. It does not fail if I move that code upwards. Thank you @pedrobaeza

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants