WIP [FIX] theme-like dependencies of the theme must be handled as theme#409
WIP [FIX] theme-like dependencies of the theme must be handled as theme#409yelizariev wants to merge 1 commit intoOCA:11.0from
Conversation
|
I become to understand how @yajo's module works 😄 and why it doesn't work on some specific themes I faced a following problem with some theme: The theme depends on other modules which have their own templates. Those templates don't work without main theme templates -- it shows less files compilation error. In order to fix that we have to treat those dependenies as a part of main theme (deactivate original template, make duplicated of them, etc). This is what this PR does. Additionally it filters out non-qweb views from processing. This PR needs more documentation on how to convert such themes to multi-themes. |
|
Little flake8 details: |
0fddcfa to
62bbe92
Compare
yajo
left a comment
There was a problem hiding this comment.
Very interesting fix indeed, thanks!
| 'ir.module.module', | ||
| string="Dependencies", | ||
| help="Theme-like dependencies. " | ||
| "Add modules here if you got error \"The style compilation failed\"." |
There was a problem hiding this comment.
So, if I get your point, this new field would define other addons which would become part of this "theme", and thus their asset views would become single-website too. Am I right? 🤔
If you faced this problem on any of the supported themes, then I think you should add this definition into the corresponding data/themes_*.xml file.
Also in demo/themes.xml would be a way of demoing this new feature too?
There was a problem hiding this comment.
You understand me correctly.
The problem of this PR is that there is no easy way to check it. All official modules works without those updates. So, seems that the only way to demonstrate it is to create new dummy theme with specific structure
|
I think I found another problem. When we have following scenario:
-- What are possible solutions to make such updates testable from CI point of view? Can we have new OCA repo with themes\modules only for tests. Could those themes be in dependencies of main module or we need to add new module, say |
|
I think the common pattern in such case is adding a new module called |
|
Why not putting them in demo data? I don't like extra module pattern, but it's needed if there's associated code that can't be hidden in non demo DBs, but that's not the case, isn't it? |
|
Solution requires references to theme modules, which cannot be created via xml. So, not just one example module, but at least 4 example modules (2 themes, 1 theme-dependency and 1 module website_multi_theme_example) |
|
Agh, too much work I think. We should leave it as is IMO. |
|
I neither like that pattern, so I'm open to suggestions, but the case at hand is quite specific. Let's put a real scenario:
Since the mocked assets are just from the I'm starting to think on alternatives:
Thoughts? |
|
In my multi-company module I implemented something in between -- it allows to admin to choose only dependencies of the theme, but not built-in dependencies: The idea about changing
|
That's true, although this addon was able to build a bridge between a theme that didn't support multithemes (a.k.a. almost any paid theme out there) and the multiwebsite support. If we don't go the way of multiple themes per website, I cannot figure out how to retain that feature (which is critical IMHO). So I still feel that's the best way to go. Besides, you can test that easily with demo data by bundling 2 demo themes and enabling both. Developing multithemes is gonna be a hard thing in any case until Odoo gives sane support for it upstream. I guess we should just add proper docs and go on with it. You can still keep this PR and convert those dependency addons into themes that get always applied behind the scenes, no matter if selected or not by the user. So, do you agree on going that path? |
I'm sorry, but I hardly understand what do you mean here. Which addon and which feature do you reference here? From my point of view both ways allow to implement same thing.
That's a good point for multiple themes per website way. OK,there is another problem we need to solve with multiple themes per website way. I'd like to have solution, that can be easily configured by working with UI and doesn't require extra actions from theme makers (because they will not read our docs and do what it says) By the way, installing multiple themes at once requires removing exclusiveness for theme-modules. It's a part of |
Yes, please, this is something missing that it's needed for completeness |
|
What if we change It allows to put demo data in xmls. It still requires a way to generate |
|
Let me reword:
It's hard to have a 100% automated system, but I guess that if you change The only other option I can imagine is that when the user selects the theme, he gets a wizard with all the addons that he can enable in that website too. All the dependency graph between chosen theme and website is forced to be true, and all other installed addons that depend on website are opt-in. But that complicates the addon and its testing quite a few. I guess we should just hope they read the docs... Well, I'm just trying to get to a good solution here. 🤔 Do you have a better idea? |
|
It could be semi-automated solution with instruction and warning in the wizard... I still believe that base idea of the updates should be new field in I'd like to prepare some prototype for it and review posible problems during the development. After that it should be easier to discuss details. |
|
Yep, I guess it all will become easier once we see the prototype, but it looks like a good design. Setting as WIP then. |
|
We can continue the discussion here: #454 |
No description provided.