Commit Graph
14019 Commits
Author SHA1 Message Date
Laurent Smet 19d999b7e6 [FIX] web: Allow select or not by default the dynamicFilters
On the bank reconciliation widget, we are using 2 dynamic filters "Receivable" and "Payable".
Otherwise, only one should be selected by default.

Enterprise PR: odoo/enterprise#35801

closes odoo/odoo#110831

X-original-commit: 2504a623f90022dfa1c64436b7bd6e113f82e82d
Related: odoo/enterprise#36207
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-01-25 10:18:32 +01:00
Samuel Degueldre ef67615e97 [FIX] web: correctly destroy apps created for legacy MockServer
A recent change in owl exposes live (non-destroyed) apps on the window.
This change causes the memory used by the QUnit test suite to balloon
out of control. The reason is that when creating a mock environment, we
create a standaloneAdapter to serve as the legacy MockServer's parent,
but this standaloneAdapter creates a dummy owl application and this
application is never destroyed. This commit fixes the problem by
registering a cleanup to destroy the application at the end of the
running test.

closes odoo/odoo#110889

X-original-commit: 27ff522cd6b0c3be32be623e375052e63bb1a04f
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2023-01-25 08:18:04 +01:00
Jorge Pinna Puissant 4cdd74fc58 [IMP] web: allow the use of setting tags on the form view
The setting tag was introduced in [1], it was restricted to the setting
view (the js_class : base_settings).

This commit move the setting tag to the form view, to remove the
restriction and allow the use of the setting tag in any form view.

[1]: c7c2959449

Part-of: odoo/odoo#110432
2023-01-25 08:18:01 +01:00
Jorge Pinna Puissant 80e1c0062e [IMP] web: documentation link widget
This commit introduces the documentation link widget, the aim is to
standardize the help documentation links that can be found in the views.

This widget will add an icon (o_doc_link), this icon is a link to the
documentation. Note that you can use relative or absolute path. The
relative path is relative to `https://www.odoo.com/documentation/server_version`,
so it's not necessary to hard-code the server version on the arch any more.

```xml
<widget name="documentation_link"  documentation="/applications/technical/web/settings/this_is_a_test.html"/>
```

Task-id: 2980478
Part-of: odoo/odoo#110432
2023-01-25 08:18:00 +01:00
Aaron Bohy adad3f06ed [FIX] web: update owl from 2.0.3 to 2.0.4
Release notes: https://github.com/odoo/owl/releases/tag/v2.0.4

 - [IMP] app: expose live apps for the devtools
 - [FIX] compiler: support t-model radio group in t-foreach
 - [IMP] runtime: improve useExternalListener typing

closes odoo/odoo#110790

X-original-commit: f7192699aea443bea278a55e0e383e59d98394c5
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-01-24 10:20:56 +01:00
Christophe Monniez 6890a0928d [FIX] web: replace invalid font for sign
closes #109361

closes odoo/odoo#110616

X-original-commit: 7be74d8232dd93789760893cecf9a8a74a9aad75
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-01-24 10:20:24 +01:00
Christophe Monniez c33bb655e6 [REM] web, project: remove mnmlicons font
The mnmliconsv21 is not used anymore for 7 years (see 660b13b)

Closes #6382

X-original-commit: 0f59b958fb9013bfd47ba16b36204bcbee731b72
Part-of: odoo/odoo#110616
2023-01-24 10:20:24 +01:00
Joseph Caburnay 89b369d096 [FIX] web: discarding create dialog should clear the value in m2o field
**Steps to reproduce:**

- helpdesk.ticket form view
- set a user on the ticket
- create & edit a new user on the fly
- discard the user creation modal
- [BUG] the avatar of the user that was initially assigned to the ticket is still displayed

**Solution:**

This is because when closing the dialog, we only clear the input. This fix
proposes to also clear the value of the field -- which unlinks the previously
selected record for the field. Note that it only makes sense to do it in m2o
fields so another test is added for extra assertion.

closes odoo/odoo#110781

X-original-commit: df783ada3281e33038253deffd75d35f44b9d579
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-24 09:11:57 +01:00
FrancoisGe 5b43a81571 [FIX] web: edit textField causes scroll
Before this commit, in a form view, editing a textField so that it was
outside the screen page caused scrolls up the page.

Why did this happen?
On each edition of the <textarea> contained in the textField, the rezise
function is called in order to always keep the correct height.
To do this, for a moment, we need to modify the textarea style to know
the scroll height. So we set the height to "auto". This results
in the textarea taking its minimum height for a moment. It will then
cause a scroll upwards because the size of the page will reduce during
this moment.

Solution:
We will add a <div> around the <textarea> which will keep the height
of the textarea. The scroll will not take place because the size of
the page will not change during the moment when the height is set to "auto"

How to reproduce:
- Go to a form view with a textField
- Edit the textField to exit the page (you need a scroll bar)

Before this commit:
When editing the textField, the scroll bar will go to the beginning of
the page

After this commit,
When editing the textField, the scroll does not move.

closes odoo/odoo#110777

X-original-commit: 339d9bf0144bcab9d3fa1674fb9f3faaad3a883d
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-24 09:11:52 +01:00
Victor Piryns (pivi) 464c5626aa [FIX] web: fix width of 1st column on bold layout timesheet report
Current behaviour:
When having the `external_layout_bold` as Document layout,
when printing timesheets, the date column takes too much width
of the table.

Expected behaviour:
Have the columns be proportional, similar to the
`external_layout_standard` layout.

Steps to reproduce:
- Install Timesheet
- Activate Dev Mode
- Change the Document layout to `external_layout_bold`
- Timesheets > List View > Select an item > Print
- Observe that the first columns (with Date) is taking 1/2 of the width

Reason for the problem:
I presume some leftover legacy styling with a `width:48%` for the
first column of a bold_layout table.

Fix:
Remove that legacy styling.

Affected versions:
- 15.0
- saas-15.2
- saas-15.3
- 16.0
- master

opw-3114053

closes odoo/odoo#110723

X-original-commit: 01c0eb16b5c3d418e5a494a825cc60f76a743377
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-23 20:27:16 +01:00
Samuel Degueldre ae1cd3d5bb [FIX] web: update jQuery to 3.6.3
This version of jQuery fixes a number of bugs in jQuery compared to
3.3.1

Some legacy list tests related to the handle widget have been skipped,
we consider this acceptable because:
- there are no remaining uses of the handle widget in a legacy list view
in the code base. The only remaining usage of the legacy list view is in
the SelectCreateDialog legacy, which is only used in our code base by
the very few legacy client actions that will be converted before v17
- the tests are only broken in enterprise, and the widget appears to
work fine in practice, suggesting a problem with the way tests drag and
drop rather than an actual problem with the code
- spending time to debug tests that will be obsolete within the next few
months and also appear to not correlate to an actual breakage of the
functionality is not worth it.

task-2291793

closes odoo/odoo#106960

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-23 16:01:21 +01:00
Hubert Van de Walle (huvw) 0b335ad510 [FIX] web: settings view: call server actions with the resId
Steps to reproduce
==================

- Go to settings
- Search for IAP
- Click on View My Services

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

In the settings view, there is a specific hack which removes the resId
from the record

https://github.com/odoo/odoo/blob/e4fe05ac07dbafb993922ff28dc3f7705c639dff/addons/web/static/src/webclient/settings_form_view/settings_form_view.js#L35-L39

This means that the records is not defined in the server action and so
nothing is done

https://github.com/odoo/odoo/blob/cd356f29abcaa1029e8a79ae76c2561f4833232a/addons/iap/views/res_config_settings.xml#L9

Solution
========

Instead of removing the res_id to mark the record as new, override
BasicModel.isNew

opw-3120995

closes odoo/odoo#110679

X-original-commit: ffb09c4ba5a4fb521a242adb0541595bd3ec1524
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-23 13:19:02 +01:00
Benoit Socias 364440456a [IMP] web: retry loading CSS before showing error
When starting a trial instance, skipping the configurator and picking a
theme, it can happen that some lazy loaded `web_editor` CSS is not ready
yet - which causes a traceback popup to be displayed.
Note that this problem could not be reproduced.

This commit introduces a retry mechanism when a CSS cannot be loaded in
order to try to preserve the trial's "wow" effect.
For readability, the link is now added after defining the Promise that
registers the event handlers.
The test is adapted in order to make the retry mechanism retry faster.

task-2972330

closes odoo/odoo#110590

X-original-commit: 6a9212d52114ccda827ad2784d0369ffd9d6526e
Signed-off-by: Arthur Detroux (ard) <ard@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-01-23 11:20:11 +01:00
Aaron Bohy 00bdf0b2e3 [FIX] web: mobile form view: statusbar button is primary
Since the conversion of the form view to owl, the statusbar field
in mobile wasn't displayed as before: it used to be a btn-primary
button (dropdown), and it wasn't anymore. This commit re-introduces
the previous design. Moreover, we adapt the style of the statusbar
button (on the left) to make it more consistent with the field on
the right (no padding + caret as it is a dropdown).

closes odoo/odoo#110629

X-original-commit: 1ba4bc2d001667fc6c2e7f7a1482b5c79bb4c3a5
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-23 10:16:50 +01:00
Aaron Bohy 5d45465758 [FIX] web: error service: no crash on prom rejected w/o error
Before this commit, the error service crashed when it had to handle
a rejected promise error with a reason that was a truthy value but
not an error.

This happens for instance in the wysiwyg editor which may reject
promises with `Request took too long (more than 10 seconds).` as
reason. We sometimes get this error on odoo.com after migrating
to 16.0, typically on a tab running in the background.

closes odoo/odoo#110613

X-original-commit: 3021f7e64382e648d15671a2a1d16847b3d72cb0
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-23 10:16:48 +01:00
Aaron Bohy e93dbe9909 [FIX] web: list: fix style of translatable fields
Before this commit, there was a flicker when clicking inside a
translatable field in an editable list view: the font-size was
reduced to 12px. This rule looks unnecessary, we thus remove it.

Bug reported after the migration of odoo.com to 16.0.

closes odoo/odoo#110612

X-original-commit: ab76b1e93513bf06b78ca97b8fdce491f498726c
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-23 09:11:45 +01:00
Jorge Pinna Puissant 5f5b0404f7 [FIX] web: align text to the end in RTL languages
Bootstrap forces some input types ("tel", "url", "email", "number") to
be LTR even if in an RTL languages, before the last update of bootstrap
this was done in [1] and [2].

The issue of forcing some input types to LTR, is that the alignment was
wrong. Now, the for the same types when using an RTL language we force
the align to the end.

[1] : 90ab752c5f
[2] : 0d650c3b19c847181fa50c88eb945792528f01cc

closes odoo/odoo#110610

X-original-commit: 05b48129999978fbe8092e6007999aeae60a3699
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-01-20 21:57:12 +01:00
Jorge Pinna Puissant e6d89466fd [FIX] web: invert position (start/end) when using rtl
Before this commit, when using a rtl language, the position of the
popper elements using the 'usePosition' hook weren't inverted.

This issue was found, for instance, on autocomplete dropdowns. The
dropdown component inverted the position if it was a rtl language, this
behaviour was moved to the `usePosition` hook.

X-original-commit: a357009cbc6aacd3f1c87f3c6e632e83c235295d
Part-of: odoo/odoo#110610
2023-01-20 21:57:12 +01:00
Aaron Bohy a7a7c150aa [FIX] web: crash when clicking deleted records in breadcrumbs
Here is a way to reproduce the problematic situation: with CRM
installed, go to Contacts, open one, clicks on its Opportunities
stat button, open one in form view, click on the "Customer" field
internal link to open again the contact in form view, delete the
record, and finally click on the first occurence of the contact
in the breadcrumbs.

Before this commit, it crashed because we ended up in an error
handler (formSaveErrorHandler) that doesn't deal with the fact
that originalError could be falsy. This is handled by the
legacyRejectPromiseHandler, but due to the low sequence of the
faulty handler, this one was executed after.

Same error would occur if you tried to open an url of a record
that doesn't exist.

This commit fixes the error handler sequences s.t. the crash no
longer occurs.

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

closes odoo/odoo#110545

X-original-commit: 8e78efa3dda2484b34422a66d3963c7b20915036
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-20 21:56:53 +01:00
Pierre Paridans 93790839b6 [FIX] web,website,point_of_sale: settings' header alignment
This commit is a follow-up of odoo/odoo@bb819f6a5c.

Even if the fix above worked around having the settinggs header's
content out of screen on smaller screen, the solution was ugly and was
meant to be improved later on.

This commit reworks the HeaderSetting's template and simplifies it to
properly fix this issue.

closes odoo/odoo#110530

X-original-commit: 0ab079664e380e5e77440e290ec604e3830108bb
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-01-20 21:56:45 +01:00
Aaron Bohy 49c94a3773 [FIX] web: correct docstring of renderToString
closes odoo/odoo#110529

X-original-commit: caf2e59da3000017682cc0211ae481081f465528
Signed-off-by: Georis François (fge) <fge@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-20 20:58:48 +01:00
Aaron Bohy f58f2e0d4f [FIX] web: do not save untouched fields on F5
Have a char field with trim option set to True (this is the
default). Open a form view where the value of this field has
leading or trailing spaces. Press F5 (or close the tab/browser).
Before this commit, a write was done before leaving, with the
trimmed value of the char field.

This isn't the expected behavior: as the field hasn't been manually
edited, we don't want to write on it.

This could be reproduced on project.task form views, on tasks with
a name with leading/trailing spaces (e.g. tasks created by mails
sent to feedback@odoo.com).

The issue occurred when we saved a record "urgently" (before unload)
because we parsed the value of each input field, and we sent it if
it was different from the initial (or last set) value. In our case,
parsing the value trimmed it, and it was thus different from the
initial value.

Bug reported after the migration of odoo.com to 16.0.

closes odoo/odoo#110528

X-original-commit: 43b7ae39e633ced6008b067bb4e63ed9be7eda01
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-01-20 20:58:45 +01:00
Renaud Thiry a8cb52afee [FIX] web: keep full urls in settings
The function that adds the missing url root on documentation links uses a regex
in startsWith, which is not supported.

startsWith is replaced with ``regex.test`` which will succeed
if the regex has any match.
Which is fine because we use a '^' to ensure it *starts* with https

task-3079113

closes odoo/odoo#110443

X-original-commit: fdaeaf69c1770edf3f33e32947326d1ebe42820e
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-01-20 10:42:43 +01:00
Michael (mcm) bc82ea7379 [FIX] web: fix issue on reorder list with colspan
The PR https://github.com/odoo/odoo/pull/109461
fixed the size of the dragging row but it did not care
about cells with colspan.
Since this PR, another one (https://github.com/odoo/odoo/pull/110349)
has been opened to manage the colspan in the
section_and_note widget but the issue also exists in
other subclass of list.
This commit moves the fix from the section_and_note
widget in the base list.

closes odoo/odoo#110487

X-original-commit: 9de8080a45773c4fd4fc2882e9135b51e3e613ce
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-01-20 08:40:46 +01:00
Adrien Schoffeniels 71d90f15b9 [FIX] web: fix create_name_field option of many2one field component
Purpose:
========
The `create_name_field` option of many2one fields in form views does not
work: when setting it, the value entered in the many2one field is copied
in the default `name` field, instead of in the field set, when clicking
on the "Create and Edit" button.

This is because an incorrect prop is used: the many2one component uses a
prop named `createNameField` for that purpose, but passes a prop called
`nameCreateField` to the Many2XAutocomplete component.

This commit renames the `createNameField` prop of the many2one field to
`nameCreateField`, to match the prop used in many2many_tags_field and in
Many2XAutocomplete.

Task-3113954

X-original-commit: c0ff0824d964cd702470076d31c066c5443ce9ca
Part-of: odoo/odoo#110474
2023-01-20 06:21:02 +01:00
Lucas Perais 8306e82a00 [FIX] web: one2many: field in list and not in form
Have a one2many that defines a list arch.
The list should not be editable, precisely, when adding a record, it should go through
a form view.

Define a standard form view in DB, not in the main arch, that doesn't have
at least one of the field that the list arch has.

Create a record in the one2many list, change a field in order to trigger an onchange.

Before this commit, there was a crash, because the onchange asked for the field present in the list
and the ones present in the form, but there was a description (the result of fields_get) only
for the fields present in the form.

After this commit, this is solved.

closes odoo/odoo#109749

closes odoo/odoo#110410

X-original-commit: c6897e1e1e5bcf3378bddeb58393baa7426b64c7
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-19 17:49:14 +01:00
FrancoisGe d84cfbf9a8 [FIX] web: click on "Search More..." with a search_default_...
Before this commit, in a form view, from the second opening of a
selection dialog by clicking on the "Search More..." button of a
many2one with a "search_default_..." in its context opened the selection
view without the filter corresponding to the "search_default_...".

Why:
The search model removes the "search_default_..." keys from the context
it is given.

Solution:
Clone the received context so as not to modify it.

How to reproduce:
- Go to a form view with a many2one field having in its context "search_default_..."
- Click on the m2o
- Click on "Search More..."
The search dialog opens with the filter corresponding to "search_more_..."

- Close the dialog
- Click on the m2o
- Click on "Search More..."

Before this commit:
The search dialog opens without the filter corresponding to "search_more_..."

After this commit:
The search dialog opens with the filter corresponding to "search_more_..."

closes odoo/odoo#110342

X-original-commit: 82293c5f4d0955c4688a619bf69e3f0049f10fb6
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Georis François (fge) <fge@odoo.com>
2023-01-19 17:49:02 +01:00
Noe Antoine 2bcad32549 [IMP] web: reintroduce the border for last kanban example page
This is cleaner and allows a more obvious line between the page
and the contents, especially since there will be a weird spacing
below the last element of the page list. This styling (vertical
notebook) is only used for the kanban example dialog and has a
limited impact.

The border was removed in the following commit:
16ddf96e0f

task-3113972

closes odoo/odoo#109105

Related: odoo/enterprise#35438
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-01-19 17:48:56 +01:00
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
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