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>
*: anelusia, artists, aviato, graphene, kiddo, loftspace, monglia,
notes, odoo_experts, paptic, test_custo, yes
The community PR [125824] introduces an automatic check on buttons to
add the `mb-2` class when several buttons follow each other, so that
they have space to breathe when split on multiple lines.
For consistency, this commit therefore removes most `mb-2` occurrences
on buttons within themes as long as they are alone on their line, but
keeps or adds the class when several buttons are next to each other.
[125824]: https://github.com/odoo/odoo/pull/125824
task-3369604
closesodoo/design-themes#680
Related: odoo/odoo#125824
Signed-off-by: Benjamin Vray (bvr) <bvr@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>
As steps are encapsuled in an arrow function from
69a5d8e3ce47238 for steps tour definition to avoid
direct Markup(_t()) interpretation, the same is done
for registerWebsitePreviewTour() of
"odoo/addons/website/static/src/js/tours/tour_utils.js"
in this commit.
This is done in anticipation of the use of
_t() (import from @web/core/l10n/translation) with
registerWebsitePreviewTour().
task-3292454
closesodoo/design-themes#678
Related: odoo/odoo#130248
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
After this commit, usages of underscore js functions
has been replaced by native javascript function.
task-3246238
closesodoo/design-themes#662
Related: odoo/odoo#125889
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
This commit fixes the xpath that have been broken by the new
we-select-pager introducing a full height version of the shape UI in
the web_editor.
task-3266751
closesodoo/design-themes#653
Related: odoo/odoo#118253
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit permits to use the new utility to enter in edit mode. This
way, we make sure that the edit mode is enabled before testing the next
step of the test. This avoids race conditions during tests.
task-3203820
closesodoo/design-themes#656
X-original-commit: 38e0c87ae3
Related: odoo/odoo#120481
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Guillaume-gdi <gdi@odoo.com>
This commit converts all odoo module of this repo by native module.
The goal is to depreciate odoo.define in favor of native module
and then simplify boot.js by removing the regexp that finds
module dependencies.
task id: 3162300
closesodoo/design-themes#652
Signed-off-by: Géry Debongnie <ged@odoo.com>
Initially, the background shapes were flipped using only CSS. This was
done by adding the classes 'o_we_flip_x' or 'o_we_flip_y' to a shape to
flip it. However, this system caused issues as it sometimes left a gap
between two connected shapes. As a result, the system was changed with
this commit [1], and the classes 'o_we_flip_x' and 'o_we_flip_y' were no
longer used from this point on.
Despite this change, in our themes, we continued to use these obsolete
classes to define whether a shape should be flipped or not. This commit
addresses this by removing all instances of 'o_we_flip_x' and
'o_we_flip_y' classes that were still being used in theme snippets and
replacing them with the new system, where flipping is defined as a
parameter in the background image URL.
Note that in stable versions where we cannot modify theme snippets, we
have added code to automatically adapt the shapes to the new system
(in this commit [2]).
[1]: https://github.com/odoo/odoo/commit/42b3ad10e0b32b7fc72f801e2c67d6baf938c566
[2]: https://github.com/odoo/odoo/commit/256ff539afe331544ccb58848f1ecd0eecbe4daa
task-2824607
closesodoo/design-themes#639
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
* theme_bookstore, theme_clean, theme_enark, theme_kiddo,
theme_loftspace, theme_odoo_experts, theme_orchid
This commit will rename the font "Muli" to "Mulish" as it has been
renamed in Google Fonts.
Closes#574
Courtesy of Kaushalya Mandaliya <kma@odoo.com>
closesodoo/design-themes#638
X-original-commit: 7afe3a3438
Related: odoo/odoo#114932
Signed-off-by: Quentin Smetz (qsm) <qsm@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>
In [1], in master, the `content` class is removed from the elements
with the `row` class in the Carousel snippet. This commit does the same
for the extension of Carousel in the "Clean" theme, to be consistent
with these changes.
[1]: https://github.com/odoo/odoo/pull/102696
task-3011192
closesodoo/design-themes#628
X-original-commit: 6232ec4af4
Related: odoo/odoo#108646
Signed-off-by: Vray Benjamin (bvr) <bvr@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Commit [1] refreshed the design of the KEA theme but unfortunately
introduced the wrong path to a shape on the s_picture snippet.
This used to cause a traceback but [2] fixed it. However, it is still
worth correcting the path so that shapes automatically chain under the
s_picture snippet of that theme.
To do so, a simple check is added when the option computes the next
shape, and looks for the broken path, if it finds it, it corrects it.
Steps to reproduce:
- Use the KEA theme
- Drop the "Picture" snippet
- Drop the text snippet under it
- Enable the background shape option for the text snippet
- The first shape is selected instead of the next one in the series.
To fix properly in master of course.
[1]: https://github.com/odoo/design-themes/commit/88b81d41dadbfaad5d0b36ba2f1c595e309438ba
[2]: https://github.com/odoo/odoo/commit/e985f8ef7a358c5aae9245267e18e65ea8383400
opw-3082292
closesodoo/design-themes#623
X-original-commit: f3bd5ab20b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
In [1], in order to allow back the edition of the images of the columns
in grid mode containing only an image, the `contenteditable` property
is removed from these columns.
This commit removes the `contenteditable` property that was set on an
image column of the Masonry snippet in the Zap theme.
[1]: https://github.com/odoo/odoo/pull/103767
opw-3028116
closesodoo/design-themes#617
X-original-commit: 6e285922a1
Related: odoo/odoo#104899
Signed-off-by: Quentin Smetz (qsm) <qsm@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 is the direct following of the PR [1].
Some themes "hard code" the background colors of some snippets, which
prevents the user to change it with a preset color without deleting the
current background first.
This commit does two things:
- remove the problematic hard coded background colors;
- replace the colors that are removed by some themes by the ones that
were set in [1] (for the searchbar and text highlight snippets).
[1]: https://github.com/odoo/odoo/pull/90749
task-2824393
closesodoo/design-themes#604
X-original-commit: 7d193e0560
Related: odoo/odoo#103123
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The Masonry snippet has been modified to be only in grid mode
and its templates have therefore been changed.
This commit adapts the themes that modify the Masonry templates to be
in accordance with these changes.
See community counterpart for details.
task-2973198
closesodoo/design-themes#601
X-original-commit: ef84cdf84d
Related: odoo/odoo#102525
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, if a theme wanted to define a main font for their
theme and let the "headings", "navbar" and "buttons" ones use the same
they had to add this in their map:
```
'font': XXX,
'headings-font': null,
'navbar-font': null,
'button-font': null,
```
Indeed, without setting the "null" values, those font would use YYY
which is the first font defined in the theme config, which might be
different from XXX. And if forcing XXX 4 times, like most themes do at
the moment, if the user wanted to change them all, he had to change the
4 ones instead of the main one.
Now, only the 'font' value use the first font defined in the theme
config if not explicitly set. So forcing the null values is not
necessary, it will be the default behavior.
The advantage is thus also functional, as most theme forced all their 4
fonts so changing the main one did not change the others.
task-2993054
closesodoo/design-themes#593
X-original-commit: fc64bce81e
Related: odoo/odoo#101068
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
New test was introduced with [1] but it actually sometimes lead to
timeout errors.
That's a common issue since we merged the frontend in the backend and
some tour (like this one) now have to start both the backend and the
frontend (in the iframe).
10 seconds is not enough to load both, it often miss just half a second.
[1]: https://github.com/odoo/design-themes/commit/0e2497b8e84eab8957028f4d63ff0899a9fe6ab3
runbot-4684
closesodoo/design-themes#587
Signed-off-by: Quentin Smetz (qsm) <qsm@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>
Migrate Bootstrap to version 5.1.3
some highlights of BS5 changes:
- Browser support: Internet Explorer is definitely gone (Goodbye! We won't miss you) ; not a huge change on the backend as we didn't supported it anymore anyway.
- Bootstrap's Javascript components doesn't use jQuery anymore! A compatibility layer is present but with some quirks, so avoid to use it if possible ; less jQuery is less overhead!
- The color contrast system in BS5 relies directly on WCAG 2.0 contrast algorithm (https://www.w3.org/TR/WCAG20-TECHS/G18.html). Some visual elements (like texts/buttons/...) may have a slightly different contrast than before.
- Background color classes ('bg-') only set the background color and don't change the foreground (aka. text) color anymore. We backported the '.text-bg-' from Bootstrap 5.2 to restore the previous behavior ; or use separate background ('.bg-') and foreground ('.text-') depending on your usecase.
- Media Breakpoint's usage has changed
- More and more CSS utility classes are introduced: use them in your templates instead of adding more custom CSS rules.
- Bootstrap still provides a quite powerful grid system, but please use it as intended by the framework (I'm looking at you '.col' without its parent '.row'). Also while keeping the same API, it was internally changed ; the main issue that you can encounter is that columns no longer apply 'position: relative', which could be solved by adding the '.position-relative' class when needed.
- BS5 doesn't allow to use multiple components on the same element (ie. adding a tooltip on a dropdown). It generates this kind of error: "Bootstrap doesn't allow more than one instance per element.
- Badge usage has changed a bit: '.badge' still exist but is now extended using utility classes (text and background colors, border-radius for pills) instead of specific '.badge-*' classes.
- '.input-group-{append,prepend}' are gone! You can now just add buttons and '.input-group-text' as direct children of the '.input-group'.
- Popover/alert components' close button use the new class '.btn-close'.
- Dropdown: the '.show' class is not added anymore to the parent group of dropdown ; some CSS selectors may still need some love.
- All data attributes of BS5 are now prefixed by 'bs-' (ie. 'data-toggle' is now 'data-bs-toggle').
Bootstrap documentation
https://getbootstrap.com/docs/5.1/migration
Task ID: 2766483
closesodoo/design-themes#580
Related: odoo/enterprise#29195
Related: odoo/odoo#95450
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
> Media query mixins parameters have changed for a more logical approach
> media-breakpoint-down() uses the breakpoint itself instead of the next
> breakpoint (e.g., media-breakpoint-down(lg) instead of
> media-breakpoint-down(md) targets viewports smaller than lg).
> Similarly, the second parameter in media-breakpoint-between() also
> uses the breakpoint itself instead of the next breakpoint (e.g.,
> media-between(sm, lg) instead of media-breakpoint-between(sm, md)
> targets viewports between sm and lg).
https://getbootstrap.com/docs/5.1/migration/#sass
Task ID: 2766483
Part-of: odoo/design-themes#580
This commit fixes the previously hardcoded color customisations in theme
Avantgarde's snippets, by using proper color variables, which allow the
snippet customisations to change dynamically.
While theoretically unstable (changing views), this was judged safe
enough for 15.0 (it would require someone to xpath a theme.ir.ui.view in
this specific theme, targeting an inline style to break; and it does not
change the current websites at all (just new dropped snippets)).
closesodoo/design-themes#579
X-original-commit: 65baa9bb4a
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 commit fixes the "Contact" header and the "default" header that
were not displaying correctly (in related themes) in the web editor
panel as expected.
task-2713578
closesodoo/design-themes#557
X-original-commit: f403f252bc
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>