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

[MIG] website: Handle Bootstrap 3->4 and Less->Scss #1819

Merged
merged 1 commit into from
Jun 15, 2019

Conversation

yajo
Copy link
Member

@yajo yajo commented May 10, 2019

Less to Scss

In case a user has customized any Less attachments, these are disabled because 99% of the times it will fail: Syntax from Scss and Less is different, there may not be a lessc executable in the Odoo 12 environment, and inherited views would probably fail finding the node to replace from XPath.

Automated resilient conversion between Less and Scss is close to impossible.

To avoid problems, these views are disabled. You are still able to fix and reenable them manually as needed.

Bootstrap 3 to 4, with new multiwebsite support

In Odoo v12, the standard behavior when a user modifies a website template is to create a modified copy which is specific to the current website (a.k.a. COW 🐮).

To benefit from this new behavior, when migrating a website from Odoo 11 to 12:

  1. If a website-specific view exists, it is migrated in place.
  2. Website-agnostic views are migrated in a COW 🐮 view, specific for each preexisting website.
  3. Webiste-agnostic views are marked as noupdate=0, so when starting a new website, you have the updated views as a starting point. To make this work, all this conversion had to be made in the pre-migration stage.
  4. The new copies will have a hidden migration column that indicates from which view was it copied.

To make this work, OCA/openupgradelib#148 is needed.

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

@yajo
Copy link
Member Author

yajo commented May 10, 2019

Set as WIP please, I still have to test this.

@MiquelRForgeFlow MiquelRForgeFlow added this to the 12.0 milestone May 10, 2019
@yajo yajo force-pushed the 12.0-website-bootstrap4 branch from 22072a7 to 4024d55 Compare May 14, 2019 12:05
@yajo yajo force-pushed the 12.0-website-bootstrap4 branch 2 times, most recently from cfaa8d7 to bf789ae Compare May 20, 2019 13:12
@yajo
Copy link
Member Author

yajo commented May 20, 2019

Ready to review. See OCA/openupgradelib#148 (comment).

@MiquelRForgeFlow
Copy link
Contributor

@yajo Please, rebase

Copy link
Contributor

@MiquelRForgeFlow MiquelRForgeFlow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yajo yajo force-pushed the 12.0-website-bootstrap4 branch from bf789ae to 84b5030 Compare June 5, 2019 08:13
Copy link
Member Author

@yajo yajo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All attended.

@pedrobaeza
Copy link
Member

pedrobaeza commented Jun 5, 2019

@mreficent @yajo I commented with @JKE-be in Spanish OCA days about the noupdate flag in several website views. They are amending this in odoo/odoo#33919, which is great, but we should modify now this code according this:

  • Do an upstream update when merged.
  • Remove view update part in noupdate_records.xml and see if this requires a manual reset of the noupdate flag for that views.

@yajo yajo force-pushed the 12.0-website-bootstrap4 branch from 84b5030 to 6267e5a Compare June 13, 2019 10:02
@yajo
Copy link
Member Author

yajo commented Jun 13, 2019

All attended, except #1819 (comment), which I understand should be done separately.

@pedrobaeza
Copy link
Member

@yajo we have merged now #1886, which contains the noupdate switch, so you can now do the last part for not adding noupdate records that are going to be removed. You have to include in pre-migration script the reset of that ir.model.data records to noupdate=False.

@yajo yajo force-pushed the 12.0-website-bootstrap4 branch from 6267e5a to 210a0a0 Compare June 14, 2019 10:20
@yajo
Copy link
Member Author

yajo commented Jun 14, 2019

Done now.

In case a user has customized any Less attachments, these are disabled because 99% of the times it will fail: Syntax from Scss and Less is different, there may not be a `lessc` executable in the Odoo 12 environment, and inherited views would probably fail finding the node to replace from XPath.

Automated resilient conversion between Less and Scss is close to impossible.

To avoid problems, these views are disabled. You are still able to fix and reenable them manually as needed.

In Odoo v12, the standard behavior when a user modifies a website template is to create a modified copy which is specific to the current website (a.k.a. COW 🐮).

To benefit from this new behavior, when migrating a website from Odoo 11 to 12:

1. If a website-specific view exists, it is migrated in place.
2. Website-agnostic views are migrated in a COW 🐮 view, specific for each preexisting website.
3. Webiste-agnostic views are marked as `noupdate=0`, so when starting a new website, you have the updated views as a starting point. To make this work, all this conversion had to be made in the pre-migration stage.
4. The new copies will have a hidden migration column that indicates from which view was it copied.
5. If the views were using any default images from snippets, they will be stored in the filestore now.

To make this work, OCA/openupgradelib#148 is needed.
@yajo yajo force-pushed the 12.0-website-bootstrap4 branch from 210a0a0 to 4f809ff Compare June 14, 2019 10:32
@pedrobaeza pedrobaeza merged commit aaba0f9 into OCA:12.0 Jun 15, 2019
@pedrobaeza pedrobaeza deleted the 12.0-website-bootstrap4 branch June 15, 2019 22:20
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