Commit Graph
16518 Commits
Author SHA1 Message Date
fdardenne 82e47bc547 [REV] web: list view: make the scrollbar above the thead in safari
The purpose of #109773 was to fix the scrollbar that appeared behind
the sticky thead in Safari.
This commit introduced a bug where elements like the dropdown,
the draggable records, creation of reacord are misaligned.

As I don't find a quick fix for the scrollbar issue on Safari, this
commit reverts #109773 .

closes odoo/odoo#110367

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-19 11:21:55 +01:00
f1deb8a457 [FIX] web: switch view position on small screen
Before this commit, the switch view was in the middle of the CP instead
of the right. This was due to the customizations of the form control
panel, this commit scopes these customizations to the form only.

Steps to reproduce:

* On mobile device, open "Project"
* The view switch is not correctly aligned to the right and not all the
  views are visible in the popover

closes odoo/odoo#110343

X-original-commit: baddfad44c34d36f26defda8fb8378003d4de4a3
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Romain Estievenart (res) <res@odoo.com>
Co-authored-by: Adrien Dieudonne <adr@odoo.com>
Co-authored-by: Romeo Fragomeli <rfr@odoo.com>
2023-01-19 10:15:34 +01:00
Aaron Bohy 942ef925b9 [FIX] web: list: display sort icon when grouped and sorted
In a grouped list view, click on the header of a column for a
sortable field. The record rows inside opened groups are correctly
sorted. However, before this commit, the icon indicating that the
column is sorted wasn't displayed. It worked fine if the list
wasn't grouped. This commit fixes that issue. It also adds a 1s
delay before opening the header tooltips (1s is the delay we have
for the other tooltips in the list view).

Issue reported in the feedback pad after migrating odoo.com to 16.0.

closes odoo/odoo#110351

X-original-commit: e68e13cfce8eb82248336361998b873f26096634
Signed-off-by: Georis François (fge) <fge@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-19 09:13:15 +01:00
Aaron Bohy cd00f242c7 [FIX] web: list/kanban: remove count limit if total clicked
Commit [1] adds a limit on the search_count done to get the total
number of records matching the domain in a list or kanban view
(displayed in the pager).
When the limit is reached (10000), a `10000+` is displayed as
total. Clicking on it performs a search_count to get the actual
number of records.

Before this commit, from that point, the count limit was set to the
total number of records. It means that if a record was created or
modified to match the domain in the meantime, and the user clicked
on the pager to see the next page (for instance), a `+` was again
displayed next to the previously fetched search_count, which looks
like a bug.

To prevent this from happening, this commit simply removes the
count limit once the user has clicked on the total.

[1] 6acfad2651

closes odoo/odoo#110348

X-original-commit: 9aab36bcfb682865b615c8fbbc107afeee3a24f4
Related: odoo/enterprise#36001
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-01-19 09:13:09 +01:00
Mathieu Duckerts-Antoine 9e3afe6d83 [REV] web: revert "[REF] web: sample server: _mockReadGroup"
This reverts commit 8d437bf.

Because of the above commit, the sample server did not correctly group
the records when a date/datetime field was used as a groupby.

We revert id and add a test.

closes odoo/odoo#110321

X-original-commit: 1a0c688aee7682919b66492636f46eff481abd29
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-01-19 08:07:53 +01:00
Hubert Van de Walle (huvw) 38fbdec503 [FIX] web: restore drag&drop in Firefox
Steps to reproduce
==================

- Go to a kanban view
- Drag a card by the title to another column
-> The record is opened instead of being moved

Cause of the issue
==================

The `.o_kanban_record_headings` elements have a `overflow: hidden` rule
There is a bug [0][1] in firefox from 17 years ago were the
mouse{enter,leave} events are not fired in that case.

Solution
========

The previous attempt [2] to fix the issue is not working (anymore ?)

Thanks to a comment in the issue, we know that we can call
`.preventDefault` on the mousedown event.

[0]: https://bugzilla.mozilla.org/show_bug.cgi?id=339293
[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1352061
[2]: https://github.com/odoo/odoo/pull/104128

opw-3120973
opw-3121312

closes odoo/odoo#110282

X-original-commit: 713026806fa712afd85cb2530006f0f880dfa240
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-01-18 17:38:31 +01:00
Aaron Bohy 25d1209cf0 [FIX] web: pager: race condition when paging and fetching count
Have a list or kanban view with 10k+ records (or manually change
`WEB_SEARCH_READ_COUNT_LIMIT` in the code). On a slow network,
click on the pager to go to the next page and click on `10OOO+` to
fetch the total number of records.

Before this commit, this might lead to a race condition where the
total number of records displayed in the pager is incorrect (if the
search_count returned before the web_search_read).

This commit fixes the issue at the pager level. We already disabled
it when clicking on next/previous or editing it. However, this
didn't prevent from fetching the count. Moreover, fetching the
count didn't disable the other features either. With this commit,
the pager is fully disabled when the user interacted with it, until
the view is reloaded.

closes odoo/odoo#110265

X-original-commit: 0ac84bda8de0c1a620d05469562932c0d04e8c3f
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-18 17:38:29 +01:00
Michael (mcm) 28df053a51 [FIX] web: don't add hotkey if readonly statusbar
Before this commit, the statusbar added a hotkey even if
it was readonly or non clickable.
Because of this, the user could change the status with a hotkey.

Now, if the statusbar is readonly or non clickable then
the hotkey won't be available.

closes odoo/odoo#110262

X-original-commit: 9569b4f463b6e82df3c8eafb8bd4329faac871b1
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-01-18 17:38:23 +01:00
Jorge Pinna Puissant 67c3a3ad9c [FIX] web: correctly center the no content helper in settings
Before this commit, the no content helper was not centered in the
settings view.

After this commit, the no content helper is centered in the settings

closes odoo/odoo#110261

X-original-commit: 7abf27a71d72dcece05a45345a81ce1dbece817e
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-01-18 17:38:20 +01:00
std-odoo 3140afff79 [FIX] web: fix the properties field in dark mode
Purpose
=======
Fix the properties types image that should be light and not dark
in dark mode. Fix the background color of the selection options.

Change the background image used for property types to a real image tag,
so we can apply a CSS filter on it for the dark mode (instead of
duplicating all images).

Task-3117416
See odoo/enterprise/pull/35408

closes odoo/odoo#110203

X-original-commit: 4982735c5a28b6f4a2d870eb679f9b8f2bfdb5d4
Related: odoo/enterprise#35941
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-01-18 17:38:09 +01:00
Aaron Bohy d0101c104a [FIX] mail,web: keep changes when changing followers/activities
Before this commit, all pending changes in a form view were lost
when the user added/removed/edited followers or created/edited
activities. In these cases, we want to reload the record, but we
also want to keep local changes. This commit restores the behavior
of previous versions.

Task 3132939

closes odoo/odoo#110246

X-original-commit: f3697e71c2d14e66509ab04bdccf3ef656cd9c8f
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-18 16:19:34 +01:00
Aaron Bohy 5dcd1db351 [FIX] web: list: correctly evaluate dynamic expand attribute
The `expand` attribute in list views can be dynamic (e.g.
`context.get("some_val_from_ctx", False)`). Before this commit, it
wasn't evaluated, so a dynamic value would always result as true,
as it isn't "O", "false" or "False". To instance, go to Invoices
and add a group by. This commit fixes that issue.

Task 3130159

closes odoo/odoo#110235

X-original-commit: 1072c4880fdd2835b0711869da06681dab20d33c
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-18 16:19:28 +01:00
Jorge Pinna PuissantandAaron Bohy f56a2b4129 [FIX] web: keep filter when leaving a kanban view and coming back
- Open a kanban view;
- Select a progress bar filter;
- Open a record;
- Came back to kanban using the breadcrumb.

Before this commit, the progress bar is selected, but the records aren't
filtered.

Now, the kanban is exactly the same as it was when we click on the
record, the progress bar is selected and the records filtered.

closes odoo/odoo#110224

X-original-commit: ca864d7e6d510ef6410898099364d854a15150d7
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2023-01-18 16:19:25 +01:00
Géry Debongnie 3a5060c691 [REM] mail: remove remaining form renderer override
The mail code had to override both new and old form views to add the
chatter feature.  Since we converted (almost) all uses of the legacy
form view to the new owl views, the old override is no longer necessary.

This commit removes it, and also removes the 'legacy_form' entry in the
registry so all screens should fall back to the new form view, which is
stable.

closes odoo/odoo#110168

Related: odoo/enterprise#35924
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-18 13:25:43 +01:00
Jorge Pinna Puissant 65244f2122 [FIX] web: settings_form_view - resIds should contains only one id
- Install two languages;
- Install Accounting;
- Active 'Default Terms & Conditions';
- Select 'Add a Note';
- Click on the translate button;
- Answer 'Ok' when asking for saving the settings before modify the
    translation;
- Save or Discard the translations;
- Save the settings.

Before this commit, a backtrace is raised. This issue raise because we
create twice the settings record. One before opening the translation and
the second time juste before saving the settings. This is a normal
behaviour in settings, as we consider the settings view as always new, a
new record is always created. But, only the last one should be sent to
the python code on the resId array.

opw-3109677

closes odoo/odoo#109803

X-original-commit: 5394f4c82829f8c7e6aaf73ddb1590f316f87ee3
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-01-18 13:25:27 +01:00
Michael (mcm) 153f143003 [FIX] web: fix dragged list view row size
Before this commit, the size of the dragged row was shrunk during
the drag and drop. Now, columns have correct width and the layout
is preserved.

closes odoo/odoo#110193

Task: 2731998
X-original-commit: 27d17c3a9ea241d05b2ffc468094117012bc0a27
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-18 12:13:18 +01:00
Aaron Bohy 942fcbfb3a [FIX] *: views: add component instance to rendering context
Owl last update fixes the leaking `this` in rendering context of
templates called with `t-call-context` [1]. Since [2], we use the
`t-call-context` directive to control the rendering context of
templates compiled from an arch (e.g. in form and kanban views).
We can now better control what people use in archs, where we don't
want them to access js implementation details, as `this` is no
longer available.

However, the component instance still needs to be accessible in
the compiled template. We thus add the `__comp__` key in the
rendering context. Since we do not want people to access it in
archs, we add a check in the view validation that this string
isn't used in dynamic attributes.

[1] https://github.com/odoo/owl/commit/df59ec49aefce2e0913fdc1792d42b9680fb28b6
[2] https://github.com/odoo/odoo/commit/4c5b867ff6b0b674cb83d1a1262ae354ebaa6d57

X-original-commit: 264f313012aa99449d1576ae1110252c13755142
Part-of: odoo/odoo#110196
2023-01-18 10:16:12 +01:00
Aaron Bohy 020ef1a694 [FIX] web: update owl from 2.0.2 to 2.0.3
Release notes: https://github.com/odoo/owl/releases/tag/v2.0.3

- fix: compiler: correctly escape backslashes when emitting block string
- fix: reactivity: don't subscribe to keys when making reactive
- fix: t-call-context: fix capture making component available in ctx
- fix: t-call-context: make `this` unavailable in rendering context

X-original-commit: 90e913172053bdecc89aceced8c490eba2490013
Part-of: odoo/odoo#110196
2023-01-18 10:16:12 +01:00
Michael (mcm) 07f121faff [FIX] web: confirm to leave settings
Before this commit, the confirmation dialog was opened
only when the user clicked on an action button.
Now, the dialog is also shown when the user clicks a
menu item in the navbar.
Of course this dialog is shown only if the user has
changed a setting.

closes odoo/odoo#110194

Task: 3102800
X-original-commit: a180178bfd73d6e5f95ee5a9e9cdc1b0d64fc574
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-18 10:16:08 +01:00
Ivan Yelizariev 85f5006018 [FIX] web: fix export m2m fields on using group_by
Export tool is based on ORM method `_export_rows`. The method has special
processing of m2m fields when user checked *Import compatible* option [1].
Before this commit the negative value of `import_compatible` parameter wasn't
passed when data are exported in grouping mode. This led to empty values in m2m
fields.

STEPS:
* Order some products via website and pay via wire transfer
* Open Orders menu in backend
* group order by any field
* expand group with the order
* add field *Transactions/Acquirer/Display Name*

[1]: https://github.com/odoo/odoo/blob/b28c44a38698018ebbbc420f6567c17b2b97c279/odoo/models.py#L894-L914

opw-2864737

closes odoo/odoo#110151

X-original-commit: 6647ac83467207f4f4ef23aac96ebaf5333b967b
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2023-01-17 16:47:24 +01:00
Jorge Pinna Puissant 4af6fcd779 [FIX] web: kanban view flickering unfiltering columns
Before this commit, when unfiltering a column in a kanban view, a
flickering occurs and the show more button is visible for a moment.

closes odoo/odoo#110130

X-original-commit: 0cd9c7dbba12e362a6445f47d52b43c48dffdb61
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-01-17 14:16:59 +01:00
luvi b6612fca69 [FIX] web: fix ids to export with selected domain
This commit fixes the export when all records are selected (full domain).
Since many records ids might be present when an entire domain is selected,
the request should contains 'false' instead of a list of ids. As a limit
is set in session.active_ids_limit, not all the records were considered.

This means that only the limit was actually exported instead of the full
list that is present. As the legacy implementation of the ExportDialog
allowed to export all records, the behavior has been fixed.

A test has been added to verify the correct parameter during the download
call.

closes odoo/odoo#110126

X-original-commit: 7200e1c5875bc148fb64187fd67d58a7d6c13c7c
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-17 14:16:54 +01:00
luvi 6a74bfae9f [FIX] web: fix export templates list filtering
Before this commit, exporting templates were not filtered as
expected. It means templates were visible even on other domains,
polluting the list of templates of a model.

This restores the legacy behavior by filtering the domain in the
rpc and only displaying the desired template list.

A test has been modified to verify the presence of the domain
filter in the parameters of the rpc.

task #3127779

X-original-commit: 30a673c044e53bfb1edc1e6733b2c83c67e0232c
Part-of: odoo/odoo#110126
2023-01-17 14:16:53 +01:00
Renaud Thiry 9828ce96d0 [FIX] web: handle falsy m2m_tags
Before this change, if a user left a string value in a m2m_tags
and removed it afterward without selecting a tag, the update method
of Many2XAutoComplete would be called with false.

As the update method for m2m_tags expects a record or record list
this caused a traceback.

The fix is to simply skip the update in that case.

task-3109811

closes odoo/odoo#110123

X-original-commit: 14f314feb7594dc888de6af4e4ad23a948044854
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-01-17 14:16:47 +01:00
Jorge Pinna Puissant e54d00f832 [FIX] web: kanban: concurrency issue with animated numbers
Before this commit, in the kanban view, if we click the progress bar to
filter the column multiple times, the count of records number's could
show an incorrect value. This occurs because when removing the filter
from the progress bar, an animation is done to the number (to increase
the value until the correct number of records). Contrariwise, when
activating a filter, the number of records is set directly without
animation. When we remove and add again a filter quickly, the animation
to increase the value of the number finishes when the filter is already
apply and the value shown is the old count of records (without the
filter).

To avoid this, in this commit, we stop the animation when the count of
record changes.

Unfortunately, testing this is very complicated (because it involves
animation frames and Date.now()), and as the cost/reward ratio is very
low, we didn't add a test of this behaviour.

closes odoo/odoo#110121

X-original-commit: 4c8bb53df6ad6382c5b168532c8493ddbb1f7252
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-17 14:16:45 +01:00
fdardenne e554f5688c [FIX] web: list view: make the scrollbar above the thead in safari
Since odoo/odoo#107631, in Safari (version tested 15.6.1),
the scrollbar stayed below the list view thead and thus looked glitchy.

Now, the scrollbar stays above the sticky thead. The fix applied is
documented in this stackoverflow thread
The fix applied is described in this stackoverflow thread:
https://stackoverflow.com/questions/20832531/mobile-safari-positionfixed-z-index-glitch-when-scrolling

closes odoo/odoo#109773

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-17 14:16:25 +01:00
Samuel Degueldre 76a44b29f5 [FIX] web: improve performance in list views with date/datetime fields
When rendering the list view, we evaluate the evalContext for each field
so that we can give it infos such as readonly, required, invalid or
empty. In doing so, date and datetime feels are serialized and added to
the evalContext, but serializing dates can be slow, especially when not
using the default English locale. Internally, luxon checks whether the
locale is English which instantiates an Intl object which can be slow
and this is compounded by the fact that the method is called hundreds of
time in a single render.

This commit caches serialized dates and datetimes in a WeakMap, as the
luxon Date objects are immutable, this is safe, and because these
objects are not recreated often, it also eliminates a lot of the calls
to luxon's toFormat. In the quotation list view, this brings the render
time from ~1100ms to ~270ms. While this is still slow and further work
will be undertaken to make the evalContext lazy (so that only
date/datetimes which are actually used are serialized), it is a good
first step and brings the performance back to a level where the list
view is reasonably usable.

closes odoo/odoo#110103

X-original-commit: 64eeeef4d3d93a9b2753520e0067aa7996988d4c
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-17 12:58:59 +01:00
Bruno Boi 204a9cef02 [FIX] web: shortcuts usermenu entry for Mac users
Before this commit:
> The command palette displays a footer tip about shortcut overlays.
> The tip is false for MacOS users.
> They cant see overlays with "ALT" key, they need to press "CONTROL".
> They do not need to do "ALT + CONTROL" in order to trigger a shortcut,
> only "CONTROL" is enough.

After this commit
> The tip is good for MacOS users too.

closes odoo/odoo#110050

X-original-commit: 65dda569f45401c002fc34fb12718de709847bf0
Signed-off-by: Georis François (fge) <fge@odoo.com>
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-01-17 10:20:56 +01:00
Aaron Bohy 057f281f20 [FIX] web: RelationalModel: find previous group with date
When a list or kanban view is grouped, at each reload, we try to
match the fetched groups with the previously created Group
datapoints, such that we can restore/keep the state of each group
(for instance, the fact that it is folded, the limit of the inner
list...).

Before this commit, this didn't work when the view was grouped by
a date or datetime field, because in those cases, the value of the
group was a luxon instance, and strict equality between two
different luxon instances, even if they represent the same value, is
always false.

This commit fixes the issue.

Issue reported in the feedback pad after migrating odoo.com to 16.0.

closes odoo/odoo#110046

X-original-commit: 80fa8f187939d78ea644a49ec17c112bcc97b32b
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-17 09:14:52 +01:00
Romeo Fragomeli dcf06d45cb [FIX] web: settings control panel's layout on small screen
The custom control panel for Settings form view has radically changed
and the old CSS rules (`.o_settings_title`, `.o_setting_search`) didn't
apply anymore, so we remove it.

Note that the form view uses a custom control panel `FormControlPanel`
but the settings form view uses the normal one: `ControlPanel`.

In this commit, we adapt the CSS to reflect the normal control panel
(e.g. the one used by the Kanban view)

Also note the differance between the old version and now:
* before (< Odoo 15.2) the input search was focused when the app was
opened and there wasn't any title
* after (>= Odoo 16) we have harmonized the search to match the other
control panel, so we have to click on the magnifying glass to show
the search input.

Steps to reproduce:
* Open Odoo on a small screen (e.g. on Mobile)
* Open the Settings app => BUG the magnifying glass isn't at the right
position.

closes odoo/odoo#110043

X-original-commit: 91ab277ef66a2ca6b34c13fcba7197f18c50aab0
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2023-01-17 09:14:47 +01:00
Victor Feyens 1a1ce16265 [IMP] core,*: check routes decorators
When overriding an existing controller route, developers can
easily c/p the route definition and call super() in the overridden method
when the route attributes are automatically deducted by odoo from the parent route.

Removing those redefined attributes simplifies the routes definition,
clearly highlighting what's changed by the override.
Also reduces unexpected behavior when modifying the base route without
noticing/considering the redefined attributes in a overridden route,
which overrides the changes made to the base route when the sub-module is installed.

This commit adds a test to catch routes attributes redefinition, and clean existing routes.

closes odoo/odoo#108512

Related: odoo/enterprise#35176
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-01-16 19:45:57 +01:00
FrancoisGe a61cd4b322 [FIX] mass_mailing: action_import add default_mailing_list_ids
The goal of this commit is to fix the problem introduced by the PR 106519.

How to reproduce the problem:
- Go to the "Email Marketing" app
- Go to the "Mailing Lists" menu
- Click on a "Mailing List"
- Click on the "Recipients" stat button
- Click on the "Import" button

Before this commit:
A dialog opens and no mailing list is selected.

After this commit:
A dialog opens and the mailing list we are in is selected.

closes odoo/odoo#106732

Related: odoo/enterprise#34453
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-16 10:32:06 +01:00
FrancoisGe 469577ac2f [IMP] web: add buttons in control panel in kanban
This commit adds the possibility to define buttons that are always
present in the arch of a kanban view.

Purpose:
Several customisations of the kanban view consist in adding an always
present button in the control panel that performs an action/calls a
model's method.
We want to support this feature directly in the framework to remove
these customisations.
The task 3082303 has added the same functionality to the list view.

Solution:
Add a "display" option that lets you know when to display a button.
The different values that can be assigned to "display":
- "selection": the button is only displayed if at least one record is selected.
- "always": the button is always displayed.
The default value of "display" is "selection".
Currently, only the value "always" is implemented because it is not
possible to select a record in a kanban. The selection of a record in a
kanban view will be implemented soon, so we decided to use the same API
as in the list view.

Exemple:
<kanban>
    <header>
        <button name="to_do" type="object" string="Do" display="always"/>
    </header>
    ...
</kaban>

Taskid: 3082390
Part-of: odoo/odoo#106732
2023-01-16 10:32:05 +01:00
Michael (mcm) 11caf332ab [IMP] web: remove title attr from navbar items
This commit removes the title attribute on navbar items.
The title was only repeating the content so it was useless.

closes odoo/odoo#109230

Task: 3097276
Related: odoo/enterprise#35562
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-13 16:27:49 +01:00
Michael (mcm) 65e43dd881 [IMP] web: make kanban group header sticky
This commit makes the kanban group header sticky, it means that when
the user scrolls the headers will still be visible on top of the view.

closes odoo/odoo#109060

Task: 2050014
Related: odoo/enterprise#35611
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-13 16:27:43 +01:00
Julien Castiaux bf4c5015ce [IMP] core: make some cookies expire on logout
Some cookies were left around even when the user logged out

The next user should log into the default company instead of the company
of the last user.

task-3077421

closes odoo/odoo#108998

Related: odoo/enterprise#35685
Signed-off-by: Julien Castiaux <juc@odoo.com>
2023-01-13 16:27:35 +01:00
Ivan Yelizariev c37c9850fe [FIX] web: convert python/js bool values in read_progress_bar
Because of an issue with converting bool values, read_progress_bar didn't work
on grouping by bool fields (e.g. Active).

Related tests worked fine because mocked server responses were different from
real server responses. So, we need to adjust mocked server too.

opw-2870937

closes odoo/odoo#103926

closes odoo/odoo#104613

X-original-commit: e6ca3ef1b38dec964dab416c6058d4c1b7161614
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2023-01-13 16:27:08 +01:00
Lucas Perais 475f8aa2c6 [IMP] web: add a onRecordChanged prop to the Record component
Before this commit, there was no way to instanciate a Record component and be
able to handle changes occuring in that record.

After this commit, a simple props is added, making this use case possible.

closes odoo/odoo#109846

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-13 14:00:04 +01:00
Aaron Bohy 5d060079f0 [FIX] web: fix test failing on split builds
Before this commit, test "click on the progressBar of a new column"
deterministically failed on split builds. It only passed with all
addons installed, and passed by chance with all addons installed.

The reason is that the flow of quick creating a record in a grouped
kanban with progressbars wasn't concurrency proof at all. Commit [1]
simply added a hook at the end of the `_save` function of the model,
which highlighted the problem: the progressbars were updated before
the group's count was incremented, so if the quick created record
was the only record of the group, the progressbar was still empty
after the quick creation.

This commit makes the quick create code more robust.

We couldn't find a way to write a qunit test for this, but it still
fixes an error in nightly builds.

[1] a882b725bb

closes odoo/odoo#109818

X-original-commit: cbfad9c36f4e52309903702f21cea457acc55ecb
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-13 09:18:53 +01:00
Aaron Bohy ad0bbb395a [FIX] web: list: pager issue after applying a filter
In a list view containing n records, apply or remove a filter.
Then edit the pager to reduce the limit to m, with m < n.

Before this commit, the pager was indeed updated, but the list
still contained the same number of records as before applying the
filter.

This was due to a kanban specific logic to handle the "load more"
feature. We stored the number of loaded records, and forced the
limit to be at least that number.

This commit fixes the issue by changing the way the "Load more"
works. Instead of loading the "limit" next records (i.e. with a
limit and an offset), we now reload the previously loaded records
+ the "limit" next ones (i.e. we leave the offset to 0, and
increase the limit).

This also prevent potential weird behaviors where the same record
appears twice, or records are skipped, when the recordset changes
between the first load and the first load more, or between 2 load
more.

closes odoo/odoo#109693

X-original-commit: 217d1191750d03918055610ba0e61f0f7522f475
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-13 09:18:43 +01:00
Adrien Dieudonné 434abe3478 [FIX] web: settings: add spacing for fa icons
Before this commit, there was no space between the label and
the icon. It's because since [1] we doesn't have a margin-right
after labels anymore (Grid to the job).

[1] https://github.com/odoo/odoo/commit/fb629dc91df1720cb0658d3e9f946a4fda83fbd0

Closes https://github.com/odoo/odoo/pull/109102

Task-3117722

closes odoo/odoo#109821

X-original-commit: 64c5c324e86b56e59947659c8269bf355799729e
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2023-01-13 00:51:50 +01:00
Romeo Fragomeli 9420f68282 [FIX] web: misalignment title of dialog on Mobile
The title is aligned to the right on mobile. This is the result of the
two rules of Bootstrap:
```css
.modal-header {
  display: flex;
  justify-content: space-between;
}
```

To avoid this we add `margin-inline: start`, to force start alignment of
the title.

Steps to reproduce:
* Open Customer (on small/mobile screen)
* Create a new Customer
* Click on Tags field => BUG title of dialog on the right

Note: on desktop there is no problem as there is the close button on
the right.

closes odoo/odoo#109796

X-original-commit: 7809abb1dcf1b0d384c0cad4065cdf15adf56081
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2023-01-12 23:48:59 +01:00
Antoine (anso) b4b390d410 [FIX] web: duplicated color management for tags
Tag color is already handled in tags_list.scss
Also, `$min-contrast-ratio: 2.2` was creating contrast issues and was
therefore dropped

part of task-3085081

closes odoo/odoo#109740

X-original-commit: 5517e41663ece74e5dc13d9ab4edf9938cfe5c4b
Related: odoo/enterprise#35701
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-01-12 16:30:16 +01:00
Aaron Bohy 509132f46b [FIX] crm,web: no crash when quickly d&d records in pipeline
Before this commit, there was a crash if you quickly dragged&dropped
twice the same record from a column to another (i.e. before the
first write was done). This was because we couldn't find (yet) the
record from the column we were dragging it.

This commit prevent the crash from happening.

closes odoo/odoo#109694

X-original-commit: b57238b577342d9a4c824b90eb7fa2a4b8e00a8e
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-12 10:05:49 +01:00
Pierre Paridans 85c6f0b9aa [IMP] web: theme-color matches community theme
This commit sets the theme-color to match the Community brand color
instead of the Enterprise one.

task-3063485

closes odoo/odoo#109181

Related: odoo/enterprise#35322
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-01-11 22:42:56 +01:00
Pierre Paridans 3664e1c0c6 [IMP] web: remove unused Android icon
This commit removes link to an Android specific icon.

Also this icon has been overriden by the favicon since
odoo/odoo@fa2cc58ef3.

task-3063485

Part-of: odoo/odoo#109181
2023-01-11 22:42:56 +01:00
Pierre Paridans ec4bb75dec [IMP] web: cleanup Apple's web-app related meta tags
Deprecated tags in favor of WebManifest.

Also this icon has been overriden by the favicon since
odoo/odoo@fa2cc58ef3.

task-3063485

Part-of: odoo/odoo#109181
2023-01-11 22:42:56 +01:00
Pierre Paridans dcae6d7afc [IMP] web: remove deprecated msapplication-* meta tags
Windows 8 tiles and superseeded by WebManifest support in Windows
10/Edge 79+ (Chromium based).

Also this icon has been overriden by the favicon since
odoo/odoo@fa2cc58ef3.

task-3063485

Part-of: odoo/odoo#109181
2023-01-11 22:42:56 +01:00
luvi 9e46fbd332 [FIX] web: fix ExportDataDialog issues
Since the rewrite of this dialog, some inconsistent behaviors were
present compared to the legacy implementation. This commit fixes some
of them.

First, many2many fields couldn't be expanded as it was the case before.
Secondly, the export list generated by default was wrong, and it has been
fixed by this commit. The defaultExportList that was computed in the as
expected for the direct export is now also used to display the right
fields from the right pane as it ignores the fields that are explicitly
not exportable.

Finally, minor UI issues have been fixed, like a wrong title.

Tests have been added to assert the correct behavior of the dialog when
selecting records.

closes odoo/odoo#109670

X-original-commit: 86b634a120de0843fbd90079e9e457818fd4acde
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Luca Vitali <luvi@odoo.com>
2023-01-11 17:58:47 +01:00
Samuel Degueldre b34429b984 [IMP] web, test_lint: forbid private class fields
We don't want private class fields to be used in Odoo because they limit
how classes can be patched from the outside, extensibility is one of
Odoo's biggest strength and we do not want to limit it.

This commit adds the `no-restricted-syntax` rule to eslint configs with
a rule that forbids private class fields.

closes odoo/odoo#109664

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2023-01-11 17:58:41 +01:00