Following the change in the way of dragging and dropping a snippet onto
the page (by selecting it from a dialog displaying the actual previews
of snippets). The themes tours have been adapted to this change in this
commit.
task-3919405
closesodoo/design-themes#817
Related: odoo/odoo#166967
Related: odoo/enterprise#66150
Signed-off-by: Robin Lejeune (role) <role@odoo.com>
The following commit [1] added a test to verify that there are no
duplicate classes in the elements of predefined page templates.
This test worked fine until it failed when we attempted to merge a
commit in which a template is rendered with empty spaces in the class
attribute of an element. The test considered the empty spaces as classes
and therefore assumed that two identical classes existed.
This commit excludes empty spaces when retrieving classes in this test.
[1]: https://github.com/odoo/design-themes/commit/758e2ab819df37c56103b1e82f1e6358b3dba00c
task-3662985
closesodoo/design-themes#792
X-original-commit: 05cfe05280
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
Commit [1] introduced a new test that uninstalls theme_buzzy. This leads
to the whole module being uninstalled because this module has all themes
as dependencies.
To fix this, we just run the test as the last test, ensuring the module
is still installed for other tests.
Ideally, tests would be independent from one another, but for now, the
order matters.
[1]: https://github.com/odoo/design-themes/commit/4cdd1db20c021ebd369b46c739591def9732eec5closesodoo/design-themes#782
X-original-commit: 45e9374699
Signed-off-by: Soukéina Bojabza (sobo) <sobo@odoo.com>
This commit adds a test that makes sure templates can be rendered on
all themes and that they neither contain duplicate classes nor
contradicting ones.
Covered templates:
- snippet blocks
- configurator snippet customizations
- new page template snippet customizations
task-3562147
closesodoo/design-themes#744
X-original-commit: 758e2ab819
Related: odoo/odoo#141074
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Before this commit, owl was in the linter's accepted global variables.
This allowed direct access to owl global object.
For instance, to use xml from owl, you could do :
`const { xml } = owl;`
or you could use it directly:
`owl.xml`
Now, owl is not accepted on linter's global variables anymore, so to
import xml, now you need to use a proper import:
`import { xml } from "@odoo/owl";`
task-id 3498859
closesodoo/design-themes#709
Related: odoo/odoo#137517
Related: odoo/enterprise#48364
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
As all the templates are now imported in the owl app, there is not need
anymore to specify the owl="1" attribute in the templates.
Part of task~3443861
closesodoo/design-themes#686
Related: odoo/enterprise#45020
Related: odoo/odoo#130467
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
This commit disables the warning (introduced by the community commit)
when test-themes is installed, as a lot of websites are created and are
not necessary when testing the different themes.
-- ORIGINAL COMMIT MESSAGE --
Prior to this commit, if a website does not have a domain, nothing tells
the user that this is a misconfiguration that can lead to broken
behaviours. For example, here are the steps to reproduce:
- Have two website (X and Y)
- Website Y does not have a domain
- Tab 1 has Website X selected
- User opens a new tab
- Tab 2 has Website X selected as well
- User switches tab 2 to Website Y
- No redirection happens
- User switches back to tab 1
- User opens the HTML editor for Website X
- Website X content is displayed
- User saves
- Content is saved on Website Y
This is pretty hard to fix as a lot of the python flow for Website uses
`get_current_website` which will uses the session's "force_website_id"
in priority.
In any case, we consider having multiple websites sharing the same
domain (or having no domains at all) a misconfiguration. Therefore, we
should warn the user of so.
This commit adds a tooltip on the website switcher for websites that do
not have a domain set. It also adds a notification recommending users
close other tabs if they switch website.
opw-3374214
closesodoo/design-themes#684
X-original-commit: 2e3188e1e1
Related: odoo/odoo#130448
Signed-off-by: Arthur Detroux (ard) <ard@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This is mostly a cleaning/refactoring change.
The current API for init hooks (pre, post, uninstall) is to pass
`cr, registry`.
But the first thing which was done by most
post init and uninstall hooks was to create an env using
the cr passed
e.g.
`env = api.Environment(cr, SUPERUSER_ID, {})`
and the `registry` argument was unused in all these hooks,
completely.
By changing the API of hooks to pass `env` instead
of `cr, registry`, we gain in average two lines in every
hooks:
- the line creating the env `env = api.Environment(cr, SUPERUSER_ID, {})`
- the line importing `api` and `SUPERUSER_ID`
Therefore removing ~250 lines of repeated code lines accross odoo/odoo and
odoo/enterprise.
In addition to these lines removed,
it also ease the API of init hooks for Odoo developers,
who are used to that `env` and not so much how to create an `env`
from a cursor.
closesodoo/design-themes#631
Related: odoo/enterprise#35084
Related: odoo/upgrade#4144
Related: odoo/odoo#108254
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
Since [1], the themes installed in the `_post_init` hook of test_themes
would not go through the `_post_copy()` anymore.
It is not a big deal as this module purpose is to ease our tests and
quickly being able to navigate through themes when we need to, but still
this is something that need to be fixed as otherwise the themes would
not really reflect how they look like.
Typically, go to the Odoo Experts theme, which is supposed to have the
"Contact" header template, it will not have that header layout.
[1]: https://github.com/odoo/odoo/commit/b8a24efa71daea1f96465b780f4f0e384ce74703closesodoo/design-themes#615
X-original-commit: fea847977d
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This commit introduces a new theme for tests purpose.
The goal is to be able to create records and simulate a real use case
without only testing through unit tests in python.
For instance, with this commit, we now fully test:
- menu creation
- page creation
- new header & footer template
- new image shape & background shape
This will be extended later to be able to test other stuff too, maybe
like changing the website logo (not supported yet). Also, our existing
standalone test in themes should use this theme instead of nano to not
rely on a real theme that might change.
Courtesy of NMI as this theme is partly based on his job.
closesodoo/design-themes#586
Related: odoo/odoo#99099
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The callstack is:
- _pre_dispatch() (http_routing)
- super()
- _frontend_pre_dispatch()
- super()
- _frontend_pre_dispatch() (website) -> Set the website on request
But in `test_themes` we were forcing the website in a `_pre_dispatch()`
override, after calling `super()`.
It means that the call to `_frontend_pre_dispatch()` was actually done
without having yet forced the website in session. get_current_website()
would then not consider the `fw` param as not yet in session, and the
request.website would be set to 1, the default one.
Later in the business code, there would be a mismatch between
`request.website` and `get_current_website()`.
closesodoo/design-themes#582
Related: odoo/odoo#98200
Related: odoo/enterprise#30691
Related: odoo/upgrade#3808
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit removes the tooltips shown when hovering over a theme in
the website switcher dropdown. This feature will be reimplemented later,
patching the WebsiteSwitcherSystray component.
It also adapts the ?fw= url parameter to force a website id during the
tours.
task-2687506
closesodoo/design-themes#572
Related: odoo/odoo#89223
Related: odoo/enterprise#28448
Related: odoo/upgrade#3464
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Now, `_post_copy()` is only called when the module is installed for the
first time on a website, not when the module is updated.
See counterpart commit in community for more details.
opw-2824045
closesodoo/design-themes#571
X-original-commit: 0e324061d1
Related: odoo/odoo#93109
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This is a backport of [1] which at the same time finally enables the
test to be able to test all theme tours. Notice that the tours should
be improved so that each step properly checks that the previous step
actually had an effect (as those tours are normally made to display to
the user and were not designed for testing). However, this is already
really useful as only checking if *entering* edit mode in each theme
does not crash is already covering most issues that can be created when
designing a theme at the moment.
[1]: https://github.com/odoo/design-themes/commit/52fef46388ec880af78c5a5f3e6152c4510548f4closesodoo/design-themes#535
X-original-commit: 208f6134a6
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
In odoo/odoo#72675 the registry for navbar widgets was changed to use
the new registry class introduced with the wowl webclient, this use site
was not adapted, causing a crash on startup.
closesodoo/design-themes#55
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The license is missing in most enterprise manifest so
the decision was taken to make it explicit in all cases.
When not defined, a warning will be triggered starting from
14.0 when falling back on the default LGPL-3.
closesodoo/design-themes#48
Related: odoo/odoo#74245
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>