Skip to content

[MIG] 11.0 website multi theme - #398

Merged
pedrobaeza merged 3 commits into
OCA:11.0from
yelizariev:11.0-website_multi_theme
Nov 14, 2017
Merged

pedrobaeza merged 3 commits into
OCA:11.0from
yelizariev:11.0-website_multi_theme

Conversation

@yelizariev

Copy link
Copy Markdown
Member

I've fixed installation problems and didn't make further testing

cc @yajo

yajo and others added 2 commits November 2, 2017 06:47
* [ADD][website_multi_theme] Allow different themes by website

This a somewhat hacky addon that adds support for setting a different theme by website.

Always updates views arch in development and demo instances.

This allows faster development, while keeping stability and no surprises in production.

* fixup! [ADD][website_multi_theme] Allow different themes by website

* fixup! fixup! [ADD][website_multi_theme] Allow different themes by website

* fixup! fixup! fixup! [ADD][website_multi_theme] Allow different themes by website

* fixup! fixup! fixup! fixup! [ADD][website_multi_theme] Allow different themes by website

* fixup! fixup! fixup! fixup! fixup! [ADD][website_multi_theme] Allow different themes by website

* fixup! fixup! fixup! fixup! fixup! fixup! [ADD][website_multi_theme] Allow different themes by website

* fixup! fixup! fixup! fixup! fixup! fixup! fixup! [ADD][website_multi_theme] Allow different themes by website

* [FIX][website_legal_page] Correctly raise a 404 error instead of a 500 if a view is not found

* fixup! fixup! fixup! fixup! fixup! fixup! fixup! [ADD][website_multi_theme] Allow different themes by website

* fixup! [FIX][website_legal_page] Correctly raise a 404 error instead of a 500 if a view is not found

* squash! fixup! [FIX][website_legal_page] Correctly raise a 404 error instead of a 500 if a view is not found

Fix tests that were getting warnings logged and random timeouts.
It's "monglia", not "mongolia".

Closes OCA#378
@pedrobaeza pedrobaeza added this to the 11.0 milestone Nov 2, 2017
@pedrobaeza pedrobaeza mentioned this pull request Nov 2, 2017
38 tasks
@yajo

yajo commented Nov 3, 2017

Copy link
Copy Markdown
Member

Could you please fix travis before continuing further reviews? Thanks!

@yelizariev

Copy link
Copy Markdown
Member Author

Travis is green now

@yajo yajo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code looks OK, although I didn't do manual tests.

Comment thread website_multi_theme/README.rst Outdated

- https://github.com/odoo/odoo/commit/15bf41270d3abb607e7b623b59355594cad170cf
- https://github.com/odoo/odoo/commit/7c6714d7fee4125f037ef194f9cff5235a6c5320
- https://github.com/odoo/odoo/commit/48fe0a595308722a26afd5361432f24c610b4ba0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can remove this now that v11 includes all of that.

@yelizariev

Copy link
Copy Markdown
Member Author

I will do manual tests by the end of this week

@yajo yajo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yikes, can't get the runbot to work... 😞 Did you do your manual tests? Code looks OK, although I'm a little worried about not manual testing because the relationship between a web page and a ir.ui.view has changed in v11

Not blocking just because of doubts

@lasley

lasley commented Nov 10, 2017

Copy link
Copy Markdown
Contributor

Runbot should be fixed now FYI. I'll be reviewing this one soon as well, thank you for the contribution @yelizariev!

@yelizariev

Copy link
Copy Markdown
Member Author

Not sure was @yajo's comment about runbot itself or about the module, but with latest module updates it should be much easier to try it on runbot -- I've updated demo data and added an instruction to the README file -- just one step is required to finish demo configuration.

@yelizariev

Copy link
Copy Markdown
Member Author

Works with Bootswatch Theme

2017-11-11 12 51 57
2017-11-11 12 51 48

@yajo yajo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Pretty cool 😊

<field name="page_id" ref="demo_page" />
</record>

<record id="menu_demo_page2" model="website.menu">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Aren't you able to create these 2 menu records here instead of creating them at the top and re-editing them here at the bottom?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I can't. Odoo source has the same approach. The reason in few computed fields that depends on each other. I will send details soon

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Well, I don't have the answer at the moment. When I did I got some problem and switched to a "splitting solution" and it began work. But now I tried to do it without splitting and it works too.

The splitting in odoo source may somehow related to splitting website.page and ir.ui.view creation for pages:

https://github.com/odoo/odoo/blob/4ecbacaf59576a22ff45615a5aa5c67244e4fb93/addons/website/data/website_data.xml#L34-L42

odoo/odoo@8baabfb#diff-d19576011e13311d9a4dd46879ebd724

response = self.url_open("http://127.0.0.1:%d" % PORT, timeout=30)
def test_0_0_0_0(self):
"""Check 0.0.0.0 downloads its default assets."""
response = self.url_open("http://0.0.0.0:%d" % PORT, timeout=30)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wow, TIL that you can use 0.0.0.0 to call to localhost!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@yelizariev what was your reason to change this? currently facing travis error on these tests in v10. both 127.0.0.1 and 0.0.0.0 are failing the tests. localhost is working just fine.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It allows using exising website records. Before the update new website was created


            ip = env["website"].create({
                "name": "127.0.0.1",
                "domain": "127.0.0.1",
                "multi_theme_id": False,
            })

@lasley lasley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code + test, thanks @yelizariev

@yelizariev

Copy link
Copy Markdown
Member Author

Shall I squash some of my commits? Is there any guidelines for it?

@yelizariev yelizariev changed the title [WIP] 11.0 website multi theme [MIG] 11.0 website multi theme Nov 14, 2017
@yajo

yajo commented Nov 14, 2017

Copy link
Copy Markdown
Member

Take a look at https://github.com/OCA/maintainer-tools/blob/master/CONTRIBUTING.md#git

Just squash your migration-related commits in one, while keeping others' history.

* update tests to new lib api (stuff related to response)

* update res.config views new framework

* doc: remove commits requirements, because odoo 11.0 has all needed updates

* update demo pages according to new framework

* ci: use 0.0.0.0 as it's used in built-in demo data

* ci: create demo page completely in xml

* doc: How to test on runbot
@yelizariev
yelizariev force-pushed the 11.0-website_multi_theme branch from 088d74c to 4bb8c4a Compare November 14, 2017 10:16
@yelizariev

Copy link
Copy Markdown
Member Author

Commits are squashed. Original history is here: https://github.com/yelizariev/website/commits/11.0-website_multi_theme-before-squash

@pedrobaeza pedrobaeza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you very much!

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.

5 participants