This commit is intended to make command palette faster. To improve this,
we decided to make the debounce delay configurable by namespace.
We also decided to limit the number of Command displays to 100.
closesodoo/odoo#84227
Signed-off-by: Géry Debongnie <ged@odoo.com>
By default, dialogs are hidden in tests, s.t. we don't see them
flicker when running the test suite. There is a css rule to hide
them, only if there's no "debug" classname on the body.
This commit toggles this classname when a test is run with
QUnit.debug.
closesodoo/odoo#84694
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
When the current app doesn't provides menu-items (or the user doesn't
have the rights to access them), the mobile burger menu should fallback
to the user menu instead of an empty one (like on the App Switcher).
Steps to reproduce (on mobile):
- on a newly database, install only "notes" app
- connect as 'demo' user
- open the notes app
- open the burger menu
=> as there is no submenus, burger menu is empty.
task-2345001
closesodoo/odoo#84692
X-original-commit: odoo/enterprise@f8e85c39e6
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
For the moment we cannot groupby an inherited field (which is therefore related) in a graph view, so it is counted as being non-stored.
Because in the `_normalize` function we do not process fields that are not stored, whereas like here
https://github.com/odoo/odoo/blob/d679cd0d8ba9a2420e81a42a698763e9be2327e1/addons/web/static/src/legacy/js /control_panel/groupby_menu.js#L45-L49.
Typically when a field has store=False but sortable=True it is inherited from a stored field, so it can be sortable
So we have to use `sortable` instead of `sort` to make it consistent.
opw-2733133
closesodoo/odoo#84612
X-original-commit: ce2a538e2988aef572171f783891cd6ee644ad14
Related: odoo/enterprise#24351
Signed-off-by: Achraf <abz@odoo.com>
*: base_automation, hr, mail, web, web_tour, website_payment
Previously, some modules were imported twice, this increases duplication
and can make refactoring more difficult. This commit enables the
no-duplicate-imports eslint rule and fixes offending modules to remove
duplicates.
closesodoo/odoo#84530
Related: odoo/enterprise#24319
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Steps to reproduce:
- Activate Debug mode
- Go to Settings -> Companies
- Create company A and B and set a different favicon for each company
- Refresh the page or switch company
Issue:
The favicon is not the right one.
Cause:
Code (that update favicon) removed when refractoring of owl.
Related commit: https://github.com/odoo/odoo/commit/0573acae2306bf5da2005852da9323ddc59e5431
Solution:
When web client start, update in JS the favicons (desktop and mobiles)
with current company favicon.
opw-2664525
closesodoo/odoo#84571
X-original-commit: fa2cc58ef34382a8b9a8d04a6e54267e39630432
Signed-off-by: Jérémy Kersten <jke@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
The function `arrayToString` did not properly support domains containing
arrays of booleans, for instance `[["val", "in", [true, false]]]`. The
array containing the boolean was directly JSON stringified without being
converted to its python equivalent.
closesodoo/odoo#84592
X-original-commit: 62f996e43098dc0f671f1e2cbb36f977ef6a36c9
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Co-authored-by: Lucas Lefèvre <lul@odoo.com>
Chart.js did badly compute the graph canvas container height (width) by
using clientHeight (resp. clientWidth) that may be rounded up by the
browser. This leads to the appearence of a useless scrollbar in the
graph view and makes it flicker on some update.
closesodoo/odoo#84476
X-original-commit: 6bceae94619da9f4943cbc1e58844fdbe0215802
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Reduces load_menus answer size by 32% (between 20kb and 200kb savings
for the initial loading of the backend, depending on the number of apps
installed). Support for SVG icons in the web client for menus/apps.
Reduced PNG icons for apps list (8 bits PNG instead of 24 as our icons
don't need more colors as they are flat designs)
closesodoo/odoo#84280
Related: odoo/enterprise#24200
Signed-off-by: Fabien Pinckaers <fp@odoo.com>
Problem occurs when we try to export report data and click
'I want to update data (import-compatible export)'.
We might end up exporting data when only field to export
is - External ID (id).
To reproduce an issue (for example):
Go to Time Off/Reporting/by Type; Remove filters from search.
Select couple records, then Action/Export.
On the wizard, click on 'I want to update data (import-compatible export)'.
Click on External ID from 'Available fields' to add it to 'Fields to export'.
Click export.
It gives traceback -
File "/data/build/odoo/addons/web/controllers/main.py", line 710,
in write_header self.worksheet.set_column(0, i, 30) # around 220 pixels
UnboundLocalError: local variable 'i' referenced before assignment
task - 2687370
closesodoo/odoo#84191
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
We bring two changes to the API of useAutofocus:
- it takes no parameter, the element focused is the one that is the
target of a t-ref="autofocus".
- it returns the element reference instead of a function to call if
one wants to force the focus on a next patch.
Indeed, having access to the element reference makes it easy to focus
that element but also allow to remove an eventual useRef that would
target the same element. This in turn permits the use of t-ref="autofocus"
alone.
closesodoo/odoo#84306
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Due to floating poing imprecisions, the position hook
overflow computations may be off under some hard to
predict circumstances.
This commit ceil all the compared parts in order
to have the same base of comparison.
closesodoo/odoo#82434
Related: odoo/enterprise#23337
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Prior to this commit the 'disabled' state (eg. studio icon in a
not-editable view) and the 'no-notification' state (eg. messaging icon
without badge) shared the same design.
While the disabled state should be used for not-clickable elements only,
available systray items should always appear clickable, even
when there are no new notifications.
This commit moves the `o_disabled` class outside the burger_menu
component, making it generic and available for other components too.
Systray items without notification are now styled normally.
The simple presence of the badge communicates the user that a new
notification has been sent.
This commit is part of v16 overall restyle (task-2704984).
task-2712151
Part-of: odoo/odoo#82434
This commit fixes the profiling menu item design, simplify the css and
removes several lines of vendor-prefix animations no longer necessary.
This commit is part of v16 overall restyle (task-2704984).
task-2712151
Part-of: odoo/odoo#82434
Since the framework's navbar uses the hamburger_menu in community too,
the `navbar_mobile.scss` code initially shared between frontend and
backend is now needed for the frontend only.
This commit is part of v16 overall restyle (task-2704984).
task-2712151
Part-of: odoo/odoo#82434
Prior to this commit the topbar responsiveness was exclusive to
enterprise.
This commit moves to community the mobile logic for navbar, burgermenu,
user_menu and company_switcher.
The design has been adapted to v16, reviewing font size/colors and
icons. This commit is part of v16 overall restyle (task-2704984).
task-2712151
Part-of: odoo/odoo#82434
In preparation for OWL-2, we introduce a new tooltip service that replaces
the hook useTooltip used by the webclient. The main reason for that is
that the implementation of useTooltip had to access el on the components
calling it. Since this won't be possible anymore in OWL-2 (el is ill-defined
in presence of multi root components) we had to find something else.
Another reason is that the useTooltip hook had no reason at all to be a
hook (as attested by the fact that only the webclient needs to call it
to have tooltip on every dom elements).
closesodoo/odoo#84160
Related: odoo/enterprise#24152
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit introduces our own icons meant to be extended over time and
to coexist with FontAwesome 4.7.
The goal is to provide a wider range of icons specifically made for our
UI and cover FontAwesome's lack of iconography for specific businesses
and functionalities.
Classes' names are available in our documentation website and the SVG
source files can be found in our `design-assets` repo.
This new bundle mirrors fontAwesome architecture; icons are rendered
applying classes to standard HTML flow-tags (normally an `<i>`), eg:
`<i class="oi oi-odoo"/>`
This implementation applies size and alignment rules directly to the
`:before` pseudo-element rather than to the class itself. The aim is to
prevent misalignment when icon classes are applied to buttons and other
UI elements, eg:
`<button class="btn btn-success oi oi-arrow--right"/>`
Note: Despite being technically feasible, this approach is highly
discouraged and should be avoided.
This commit also introduces utility-classes specifically made for
our UI. In detail:
- Fours sizes: '.oi-small', '.oi-normal', '.oi-large', '.oi-larger'
Relative to the parent font-size, these classes cover a range from
`0.8em` to `1.77em`. Each size has been designed to match our default
text-fonts in the attempt to compensate font-icons common alignment
issues (https://css-tricks.com/icon-fonts-vs-svg/#aa-positioning ).
- Responsive classes: `.oi-[screen]-[icon_size]`
Responsive classes mirror Bootstrap ones and can be combined to
achieve different size results at specific resolutions, eg:
`<i class="oi oi-studio oi-larger oi-md-normal oi-lg-small"/>`
- Fixed width: '.oi-fw'
Mirrors FontAwesome 'fa-fw' by setting icons at a fixed width.
Our implementation adapts according to size and responsive classes.
- Animations: '.oi-spin', '.oi-pulse'
Mirrors FontAwesome default animations.
This commit is part of v16 overall restyle (task-2704984).
enterprise: https://github.com/odoo/enterprise/pull/23848
task-2745275
Part-of: odoo/odoo#83501
This commit reduces fontAwesome footprint by removing legacy font-files
(~750kb). It keeps WOFF(s) formats for browsers and TTF format for PDF
and ICON to PNG generations.
TTF format has been removed from the CSS [@]fontface rule, but it's
still called directly in python when needed[1].
This commit reviews the CSS too, removing obsolete vendor-prefix rules
and discontinued fontAwesome classes.
Part of v16 overall restyle (task-2704984).
task-2745275
[1] https://github.com/odoo/odoo/blob/15.0/addons/web_editor/controllers/main.py#L45
Part-of: odoo/odoo#83501
This commit "forks" fontAwesome into `src/libs` in order to allow
further customization.
Part of v16 overall restyle (task-2704984).
task-2745275
Part-of: odoo/odoo#83501
Since [1] when web was migrated to OWL, the cookies bar was considered
as a parent modal of any openend modal that got closed - thus preventing
scrolling the full page.
After this commit the cookies bar in the front end is not considered as
a remaining modal anymore, and therefore does not prevent scrolling on
the currently displayed website page.
[1]: https://github.com/odoo/odoo/commit/29731b404fe624b733d784cd4321113d6b0d27b7
task-2741894
closesodoo/odoo#84128
X-original-commit: c1aab97e6b4e8b916c7d79db5f278c746fd6b119
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
When combining the context for an RPC, the
additional context is being added before the raw
context.
Because of this, a use case such as:
- A o2m field with a context {'field': 'a'}
with a tree editable view below it
- That view defines controls to create lines,
which would change the context key 'field' to
another value.
=> The field context key would take precedence on
the creates key, making it impossible to override
that key in specific circumstances.
closesodoo/odoo#83996
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Purpose
=======
When we group the record based on a boolean fields, we want to show
"Yes/No" instead of "True/False".
This has been done for the list view, the pivot view and the kanban
view.
Task-2648390
Part-of: odoo/odoo#79911
Purpose
=======
"True" and "False" are not very user-friendly, especially for
non-technical people. Instead, we want to have "Yes" or "No" for the
custom filters, when we search on a view, which have more sens for
non-technical people.
Task-2648390
Part-of: odoo/odoo#79911
Since [1], the test suite waits for 5s to start running. It's
really annoying when you run the suite in your browser, to debug
a single test or a sub suite. Waiting for 5s to determine whether
all modules can be loaded or not is not necessary anymore since
all assets coming from the same bundle are loaded in a single
file, even in debug=assets. This is true under the assumption that
there's no js module in assets_common requiring a module in another
assets bundle, which seems reasonnable.
[1] 468eb84fb4closesodoo/odoo#83805
Signed-off-by: Géry Debongnie <ged@odoo.com>
Allow wysiwyg field html to blend better in odoo view,
Remove the default resizer and make the field html's size
automatically fit its content
task-2637488
# Conflicts:
# addons/project/static/src/js/project_form.js
Part-of: odoo/odoo#83792
Following recent conversion of onchanges to computes in the sale scope,
it was observed that updating one line triggered price recomputation in other
lines (which isn't expected).
After investigation, it seems that the `product_packaging_id` field is considered
modified and sent on SO save for all the lines, which triggers the `product_uom_qty`
record computation, then the whole price computation is triggered, since it depends
on that quantity field.
This commit aims to fix this case by only considering a m2o field as modified
if its value was effectively changed.
closesodoo/odoo#83252
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Add new utility classes to handle basic opacity behaviors.
Once migrate to BTS5 these classes should be generated using the
upcoming utility classes API.
Part of the overall v16 SCSS optimization/restyle, task-2704984.
task-2731819
Part-of: odoo/odoo#83108
Recently, a lot of the network infrastructure code was rewritten. A lot
of this new code doesn't account for the possibility of being on an
external website, and so network requests made with relative URLs would
not make their request to the odoo server but to the server serving the
external page which would fail.
This commit fixes that by replacing the regular rpc service with one
that will add the correct prefix, as well as patching the
"browser.fetch" method to do the same. Additionally, the localization
service is now less fault-tolerant, and won't silently fall back to a
default configuration if it cannot get the translations from the server,
as such, the tranlsations route is made available cross-origin, which
has the added bonus of making translations available to the embeded
code.
opw-2677184
closesodoo/odoo#83690
X-original-commit: 5ec64d15197e8d6cc7b115aeaca99aa49de0f151
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Purpose of this commit to add format_type option in daterange
widget.
So, In this add format_type option in nodeoption which convert
actual formatType to given format_type in option and add test
case for that feature.
task:2710539
Closes: #81630
Related: odoo/enterprise#22994
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Since [1] when web's owl services were made available to the frontend,
the navigation mixin does conflict with the hotkey service.
E.g.: navigation mixin consumes the 'alt' keyup event, which prevents
the hotkey service from cleaning up the hotkey overlay.
After this commit the old mixin is neutralized and hotkeys in website's
pseudo-backend layer are handled by the general hotkey service.
Also since [2] the menu items are inside `<div>` instead of `<li>`,
adapted the scss to take this into account.
Also added a CSS rule to neutralize the outline on website's menu
dropdowns which are `<a>` instead of the already handled `<button>` in
web.
[1]: https://github.com/odoo/odoo/commit/db7b485d984e50fae5a52308634166460e5fc908
[2]: https://github.com/odoo/odoo/commit/84715436d87bb05b421bc9ccaacda67d07571690
task-2738578
closesodoo/odoo#83529
X-original-commit: 88438fa9b363530aa4e5dec5599c1568fb7ccea0
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
In the calendar UI, the avatars ratio has been edited differently with
the original
closesodoo/odoo#83494
X-original-commit: 81875cf0d0b2db5e2b2e0e70178d5ea04bdd509b
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
OWL-2 is in preparation and will be soon merged. One of the changes it
will bring is that it will be no longer possible to use the directive
t-ref on a tag component. Here we refactor the code in order to remove
two uses of such t-refs.
closesodoo/odoo#81984
Related: odoo/enterprise#23464
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
OWL-2 is in preparation and will be soon merged. One of the changes it
will bring is that it will be no longer possible to use the directive
t-on on a tag component. Here we refactor the code in order to remove
one use of it in the action service.
Part-of: odoo/odoo#81984