1) Avoid the storage of all country flags as ir_attachment (230+
ir_attachment in a new db) to reduce the filestore of databases.
The country flags are nearly static and not expected to be modified on
Odoo instances.
This change is based on the new "image_url" widget logic (see previous commits).
2) Extend the flag coverage for countries
Add the missing country flags & specify a mapping to provide flags
for overseas administrated countries/territories.
Storing attachment in database (when not specified as an url attachment) copies
the given file in the filestore. When not necessary, this should be avoided to reduce
the databases footprint (and their backups).
On a given instance, the gain is minor, but on servers with hundreds of databases and/or
backups, the impact is noticeable, leading to an economy of scale.
PURPOSE
Clean code. Be more performance oriented.
SPECIFICATIONS
Improvements applied in this commit
* not all() --> any(not) for earlier returns;
* all([generator]) --> all(generator) to avoid unnecessary list casting.
This code construct is better managed by all;
This commit will probably not have a big performance effect on standard
production databases. However each performance and cleaning improvement
is welcomed.
LINKS
Task ID-2328619
closesodoo/odoo#56810
X-original-commit: 1cc6bb1231401ea7f501d2f5b5e9641ec8734850
Related: odoo/enterprise#12802
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
To avoid to manually invalid the lru cache and probably miss some place
(assets, website menu, qweb view, website, company, ...) we use the classic
cache.
Courtesy of @rco-odoo for the help and review
closesodoo/odoo#56744
X-original-commit: 98e12901c97a67dc87f21647473754cd6f384d4a
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
- Use a text label for selected header effect instead of a big image
- Do not animate all images of header effects at the same time, only on
hover in the select.
- Review the images for header/footer templates.
Part of https://github.com/odoo/odoo/pull/56427
task-2264627
X-original-commit: 522c51880949bf601af67c26fd82c7f28ca56f8c
Also change the default behavior of all shadow options: now switching
inset / outset resets to default bootstrap values.
Part of https://github.com/odoo/odoo/pull/56427
task-2264627
X-original-commit: eb34a7841978aea5c3f2d04121fd0e6adda94e3b
Co-authored-by: Cocographique <nmi@odoo.com>
*: website_sale, website_sale_wishlist
Part of https://github.com/odoo/odoo/pull/56427
task-2264627
X-original-commit: 77d82cfbddb64cc7302672c7741eb65c9fc4a125
*: portal, website_sale, website_sale_wishlist
Portal-without-website header is now more basic, without the need of
a collapsed element. It is then entirely replaced when website is
installed with header templates, t-calling all the main parts.
Part of https://github.com/odoo/odoo/pull/56427
task-2264627
X-original-commit: d3d5983e0a76eb6500e0d3f78f128879b50390e0
Co-authored-by: qsm-odoo <qsm@odoo.com>
Also remove the "Gothic A1" font-family entirely as it is unnecessarily
heavy. Users can still using by importing the font explicitely if they
want to.
Part of https://github.com/odoo/odoo/pull/56427
task-2264627
X-original-commit: fd599daeacda187d1224cfd9e16f958423845c3d
Co-authored-by: qsm-odoo <qsm@odoo.com>
The feature will be replaced by a more advanced one allowing to put any
static content at some locations in the header.
Part of https://github.com/odoo/odoo/pull/56427
task-2264627
X-original-commit: f186ce1c313d28cc17df03b9021279b9a2f4acd8
Move it in an external view to be able to place it at a different
location depending on the header template.
Part of https://github.com/odoo/odoo/pull/56427
task-2264627
X-original-commit: 010efaeb6d96f156eced62dfd7d842f1d588698f
Move it in an external view to be able to place it at a different
location depending on the header template.
Part of https://github.com/odoo/odoo/pull/56427
task-2264627
X-original-commit: b4866d192e6f4fdfba15b65fa2c209b35b7eb8c0
This commit also add the possibility to indicate a "top gap" = a part
on the top of the header which is not supposed to be shown once the page
is scrolled (this is a leftover of the "preheader" task which was
cancelled for something better, but that JS code still made sense as a
possibility).
Part of https://github.com/odoo/odoo/pull/56427
task-2264627
X-original-commit: 38ba41779f3b83219de41542e2132f0b9a194cce
Co-authored-by: Benjamin Vray <bvr@odoo.com>
Since the images are now lazy loaded by default, the website menu was
not loaded correctly anymore when a mega menu was enabled and that there
was an image inside. Indeed, the menu loading waits for all images to
be loaded to compute the menu that should be in a dropdown when there
are too many. As the ones in the mega menus are hidden when the menu
is closed, the new lazy loading feature does not load them... which
makes the menu loading wait for something that is not being done.
This commit solves the problem by not waiting for images inside mega
menus. This could actually be done as a stable fix in stable versions
as there is no point waiting for those particular images in any case.
This will be only merged in master as it is not strictly a bug though,
at least for now.
Part of https://github.com/odoo/odoo/pull/56427
task-2264627
X-original-commit: 2d9667c2286354bf22c1cfea06c06a6b9250ba24
Currently, admin and system users have the ability to manually create new
visitors from UI, which was introduced since ACL revamp[1] on visitors.
However, even admin should not be able to create visitors manually. Indeed
having a create button makes no sense as everything is managed through
frontend. Those menus are mainly present for reporting and displaying
information.
This commit fixes the behaviour by preventing manual creation of visitors
for all users including admin.
[1] - 5e605f5
Task ID-2288363
closesodoo/odoo#56651
X-original-commit: 1db514f8d2a9f1ba6861c89ced9a2a9f5dcf48be
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This is unfortunately replacing old hacks by new ones but using SCSS
variables for this is more consistent with the rest of our website
customization possibilities.
The hack here is for the UI which is controlling two SCSS variables at
the same time (body-image and body-image-type). This has to be improved.
closesodoo/odoo#56496
X-original-commit: 6b400c433b352d7dbba0d3770600857df4872c50
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
closesodoo/odoo#56435
Note: this fix may need to be backported as soon as possible
X-original-commit: 8e437a79e9f6948351a8c7f2f51daba4ffbed8e4
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The mega-menu inside "+" menu (that contains items that do not fit on
one line) could not be used at all.
This is because we only managed normal dropdown-menu (ul) and not
mega menu (div.o_mega_menu).
But once the menu is shown, there is an issue because the two main
widgets are column on "lg" breakpoint, and inside the menu there is no
width but we might still be on lg breakpoint.
So this commit also try to reset col values (max-width and flex) as is
the case in mobile view (because "col-lg" are not applied).
opw-2313019
closes#56367closesodoo/odoo#56426
X-original-commit: 19de393288dec96c7151a58e8fafd70978d305e9
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Before this commit, the files keyboard_navigation_mixin.js and browser_detection.js
were defined both in assets_backend and in assets_frontend
Obviously then, they should be defined in assets_common, as this commit intends.
X-original-commit: 42e7c01024dcc8f5d0d0ee13c120bd31374837cd
Now any set of widgets and rows can be placed in a we-collapse element
so that those elements can be foldable. The first element inside (or
the mentioned "string" on the we-collapse element itself) is used as the
always shown element (with a toggler on its left to toggle the
visibility of the other items).
we-collapse inside other we-collapse is supported as well.
Limitations / Other infos:
- The use of '⌙' and   characters is not automatic (yet?).
Sometimes it actually make sense to use them without a we-collapse or
to not use them in a we-collapse.
- The use of we-collapse is limited to widgets inside the same option.
So unfortunately, there is no current way to add all bg image options
in a folable section as those contain many different options. Maybe
in the future.
Part of https://github.com/odoo/odoo/pull/56350closesodoo/odoo#56352
X-original-commit: d9c450ac97de40c71aebd487cff725bfda6a577b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Use case:
When the server is restarted, the python is updated,
but some users may have an ongoing session in a browser tab
This may lead to code being unsynchronized and ultimately to some
odd bugs.
Purpose:
When we are in such a case, that is, the assets were recomputed
after a update of the code and a restart of the server by the request of another user,
notify connected users that assets have changed.
Then propose them to reload the page.
Known caveats:
- This is not a developer's feature.
Since assets computing is ORM cached, they have limited
opportunities to rebuild. Namely, the feature won't trigger
each time the JS has changed, rather, it will
when JS has changed AND the cache has been reset somehow (e.g. when the server is restarted).
- This not a portal/website feature either, but only in backend.
Business clients won't be notified that the JS has changed.
- While requests debug=assets do trigger a recomputing
of the *components* of bundles, they do not save a bundle
This means that the requests that sends the notification
cannot be debug=assets.
Task 2034462
closesodoo/odoo#39875
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>