Commit Graph
12238 Commits
Author SHA1 Message Date
Habib (ayh) 43f516e90d [IMP] web: file_uploader: callback after all files have been uploaded
Part-of: odoo/odoo#96672
2022-08-27 19:01:11 +02:00
Pierre Paridans 062ef13483 [FIX] web: restore sizing for XXL Form View
XXL Form View doesn't apply the right max-width (1320px instead of
1140px).

This is due to the precedence of the selector for `.o_xxl_form_view`
since https://github.com/odoo/odoo/pull/96627. Also this code block
applies to both legacy an new FormView instead of only the new one.

This commit fixes it by properly targetting the `.o_form_view` with the
`.o_xxl_form_view` and restores the previous behavior.

closes odoo/odoo#98686

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-27 03:33:30 +02:00
Samuel DegueldreandAchraf Ben Azzouz b9bdf2a139 [FIX] web: display translation alert after status bar
The newly converted form view displays the translation alert above the
form renderer, but we want the translation alert to be present below the
status bar when there is one.

This commit fixes that by moving the display from the form controller to
the form renderer.

closes odoo/odoo#98434

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Achraf Ben Azzouz <abz@odoo.com>
2022-08-26 21:36:58 +02:00
Brieuc-brd 8fa6e923d0 [REF] web, website: FormView, review and simplify scss
Review, simplify SCSS and adapt legacy code.
Part of the overall v16 SCSS optimization/restyle, task-2704984

task-2918464

closes odoo/odoo#98101

Related: odoo/enterprise#30421
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-26 18:41:36 +02:00
Brieuc-brd d84af2aa46 [MOV] web: move FormView variables into the component folder
This commit moves the form variables from primary_variables.scss to
the FormView folder.

Part of the overall v16 SCSS optimization/restyle, task-2704984

task-2918464

Part-of: odoo/odoo#98101
2022-08-26 18:41:35 +02:00
Sébastien Geelen (sge) d32a8c53c2 [IMP] web,web_editor,mass_mailing,sms: new dynamic placeholder
Introduce a new Dynamic Placeholder Generator
in mass mailing and SMS creation.

Using a specific character (#) in subject or via the PowerBox in body
we open a field selector popup, which can be use to select
the wanted field and enter a default value. on validation, the dynamic
placeholder will be inserted in the corresponding input/editable.

task-2154624

closes odoo/odoo#71878

Related: odoo/enterprise#30333
Related: odoo/upgrade#3766
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-08-26 17:16:10 +02:00
qsm-odoo 06e93c2489 [FIX] web: prevent wrong date format if picker used too soon on frontend
If datetimepickers were used too soon after page loading, they would use
the wrong format and UI options as the code in charge of initializing
those options was not fully lazy loaded yet.

With this patch, we prevent the tempusdominus lib to consider pickers
that are in a body that is marked by the lazyloader during the lazy
loading of JS files. We could potentially not add the lib attribute
(data-toggle="datetimepicker") on those elements and let the business
code initializing the pickers add it but that would not have been a
stable fix and it may be better this way as this works generically.

opw-2944720

closes odoo/odoo#98917

X-original-commit: 7e012340d3adcd64e829a5dca34173da24d649bc
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-26 06:55:43 +02:00
william d92a8b5ffd [IMP] web: continue to edit lists when editable=top
Previous behavior
================

When `editable=bottom`, when we hit tab until the end of the line, the
user starts to create a new record.
But when `editable=top`, when hitting tab multiple until the end of the
line, the user starts to edit the first line that was existing before
instead of creating a new one.

New behavior
============

The behavior is consistent between both cases: the user can always
continue to edit lines one after the other.
The behavior for `editable=bottom` is not changed, but `editable=top`
continues to add lines on top one of each other.

linked to task-2879904

closes odoo/odoo#98603

Signed-off-by: Georis François (fge) <fge@odoo.com>
2022-08-25 22:46:00 +02:00
MerlinGuillaume 4ffde5b8b9 [FIX] web: use different hotkeys for 'ADD' and 'SAVE' buttons
A modal using the 'ADD' and 'SAVE' buttons will have the same keyboard
shortcut for both of these buttons

Steps to reproduce:
1. Install Inventory
2. Go to Inventory > Operations > Transfers and open a transfer with a
contact and in status 'Ready'
3. Click on 'EDIT' and open the contact in the Delivery Address with the
quick edit button
4. Push on 'Alt' key: the 'ADD' and 'SAVE' buttons use the same shortcut

Solution:
Modify the current hotkey used for button 'SAVE'

opw-2954146

closes odoo/odoo#98884

X-original-commit: 0f8d28269f4900e70d7fefbb359580390656cdf7
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2022-08-25 18:25:22 +02:00
Bruno Boi ec70294e64 [FIX] web: invalid kanban record quick_create stays open
- Before this commit
Validating an invalid kanban record on quick creation
would leave the quick creation mode.

- After this commit
Validating an invalid kanban record on quick creation
will stay in quick creation mode, indicating which fields are invalid.

closes odoo/odoo#98874

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-25 12:05:47 +02:00
FrancoisGe 2e23ac138d [FIX] web: debug menu view metadata
Before this commit, in a legacy view, clicking on debug menu
"View Metadata" causes a crash.

closes odoo/odoo#98866

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-25 12:05:36 +02:00
Bruno Boi c343318f93 [FIX] web: keydown traceback on empty m2m_tags(_avatar)_field
- Before this commit
On an empty m2m_tags(_avatar)_field, triggering a keydown event yields to a traceback due to an owl issue.
This will be fixed in owl later.

- After this commit
The 't-on-keydown' attribute on TagsList component has been moved into the tags themselves.

closes odoo/odoo#98840

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-08-25 12:05:24 +02:00
Bruno Boi d56468eb66 [FIX] web: disable browser autocompletion for AutoComplete component
- Before this commit
The browser autocompletion feature may conflict with
the AutoComplete component. First, the browser could
display its own autocompletion dropdown over our component's.
Secondly, selecting an item in the browser's autocompletion
dropdown simulates a keydown event with an undefined 'key' property,
leading to display traceback when the AutoComplete component
uses the keydown event (i.e. in getActiveHotkey).

- After this commit
The <input/> of our AutoComplete component now has the following attr
`autocomplete="off"`. This disables the browser's autocompletion feature
for this <input/>.

Part-of: odoo/odoo#98840
2022-08-25 12:05:24 +02:00
Julien Mougenot 1ab23b9467 [FIX] web: Prevent drag on kanban record dropdown
Before this commit, clicking on any part of a kanban record would
initiate a drag & drop sequence, this included its dropdown. This caused
2 issues:

- You could start to drag & drop records by dragging their still opened
dropdowns ;

- Said dropdowns would remain open when dragging their parent record.

This commit fixes both of these issues by hiding dropdowns during drag
sequences and preventing drag when clicking inside the dropdowns.

closes odoo/odoo#98791

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2022-08-25 12:05:15 +02:00
Julien Mougenot cf4a8f198f [IMP] web: Add 'ignore' param to useSortable
This commit adds a new parameter to the 'useSortable' hook that allows
HTML elements to prevent a drag sequence. This 'ignore' param can be a
string or a function returning a string, that will be a selector
targetting the elements that need to prevent drag & drop sequences.

Part-of: odoo/odoo#98791
2022-08-25 12:05:15 +02:00
Julien Mougenot b8d4c41331 [FIX] web: Fix behaviors of ProgressBarField
This commit fixes behavior issues in the progress bar field:

- the progressbar would not write on a field if it was declared as
'readonly' on the server (it sounds counter-intuitive but this widget
was supposed to write on records unless given the 'readonly' flag in the
field options);

- the "isEditable" prop was incorrectly computed, resulting in the field
not being editable in kanban views when it should be;

- when editing a value in the field, the focus should be automatically
given to the first input.

These issues have been fixed in this commit.

closes odoo/odoo#97411

Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2022-08-25 12:05:03 +02:00
Julien Mougenot de0d409efc [IMP] web: Add params to useAutofocus
This commit introduces an object parameter to the "useAutofocus" hook,
that has 2 new optional keys:

- "refName": to override the ref "autofocus" (effectively allows to run
the hook multiple times)

- "selectAll": selects the whole value of the input/textarea (instead of
putting the cursor at the end).

Part-of: odoo/odoo#97411
2022-08-25 12:05:02 +02:00
FrancoisGe c200b0cc8a [FIX] web: many2one close "No records"
Before this commit, when a many2one's input shows the choice
"No records", the dropdown does not close.

Cause:
When blurring, the many2one will select its first item. In our case,
"No records" is not selectable and it will not close the dropdown.

How to reproduce:
- go to a form view with a many2one field
- insert a non-existent value in the many2one ("No records" is displayed)
- leave the many2one input ("blur" event)

Result before:
The dropdown containing "No records" is still open.

Result after:
The dropdown containing "No records" is closed.

closes odoo/odoo#98799

Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2022-08-25 10:32:04 +02:00
FrancoisGe 15a032e84a [FIX] web: placeholder in required SelectionField
This commit adds the possibility of having a placeholder in a
required SelectionField.

Solution:
We always add a false option with the placeholder but it is "display:none"
if the field is required.

How to reproduce:
- create a new record in a form view with a required selection field

Result before:
    The first option of the selection field will be selected

Result after:
    The placeholder of the selection field will be selected

When editing the selection field, the selection field does not propose
the placeholder.

closes odoo/odoo#98823

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-25 09:06:30 +02:00
Samuel Degueldre 3f7f361d5f [FIX] web: stop crashing on concurrent update of field wrapper
Previously, if you updated a legacy field widget in a new view twice in
quick succession, it may be that the first update recrates the widget,
but the second update doesn't wait for that widget to be created by the
previous update, even though the second update may rely on the widget's
$el to be defined, which can result in a crash.

This commit fixes that by making sure the widget has finished starting
before attempting to recreate it with the new params.

closes odoo/odoo#98822

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-25 04:21:21 +02:00
Simon Genin (ges) cc6c1e5d92 [FIX] web: kanban dropdown should close on click
With the current implementation of the kanban dropdowns, clicking on a
element doesn't drop the dropdown.
Often it's not a problem as the clicked element initiates a new action.
However, on some occasions (like with a color picker), we want it to
close.

Waiting for a kanban card refactoring, we need to find a bit of a hack:
we wrap the content comming from the arch inside a small component that
only listen for clicks and close the parent dropdown.

closes odoo/odoo#98773

Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2022-08-25 04:20:45 +02:00
Samuel Degueldre f00df383ea [FIX] web: correctly compute colspan of empty line in list renderer
Previously, the colspan of empty lines in list view did not account for
the fact that the column with the delete action is not always present,
resulting in incorrect colspan on empty lines when it is not.

This commit fixes that by accounting for it, and also fixes the size of
the header of that column, which is supposed to be fixed at 32px but
wasn't in some circumstances.

closes odoo/odoo#98711

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-25 03:11:45 +02:00
Aaron Bohy 545e2378ab [FIX] web: render label with empty string to preserve layout
Previously, when a label in a form arch had an empty string attribute,
we would not render it at all as it seemed useless. In practice, some
existing form arch rely on empty labels being rendered for layout
reasons, and the corresponding views are now broken.

This commit fixes that by instead rendering an empty label, just as
legacy views used to.

Part-of: odoo/odoo#98711
2022-08-25 03:11:45 +02:00
Samuel Degueldre a6dd7075b3 [FIX] *: remove display: contents from field widgets and adapt code
With the conversion of the views to owl, we added an extra div around
fields that represents the whole field, and wraps potentially multiple
elements that may be rendered by a field widget. This changes the DOM
structure, and to allow concrete fields to control everything about the
way they are displayed, we decided to use the css rule "display:
contents" for that div. As it turns out, while this does give more
control to the field widget, it breaks a lot of existing css rules, and
also prevents classes that are applied on that div from the arch from
affecting any css property related to layout (such as margin, position
or padding).

Because of that, we decided to revert this change, and set this div's
display property to inline-block (the same as legacy field widgets) and
adapt the few fields where this does not work out of the box, which
fixes many issues.

Part-of: odoo/odoo#98711
2022-08-25 03:11:45 +02:00
Bruno Boi a7fb02e3fa [FIX] web: autocomplete should keep input value on search more
# Before this commit
When searching more in an autocomplete component,
the input value is emptied before opening the Search More dialog.

# After this commit
The input value keeps its content when the Search More dialog opens.

closes odoo/odoo#98639

Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2022-08-25 01:54:04 +02:00
FrancoisGe 145234749a [FIX] web: create="0" in a grouped kanban view
This commit is to remove the "Create" button in a grouped kanban view
with create="0".

Problem:
In a kanban view with create="0", the "Create" button should never be
displayed.

How to reproduce :
- go to a kanban view with create="0"
- group the view

Result before:
The "Create" button is displayed

Result after:
The "Create" button is not displayed

closes odoo/odoo#98691

Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2022-08-24 18:38:53 +02:00
Julien Mougenot 7214ef8cf7 [FIX] web: Fix input style in editable list
This commit fixes a visual issue with the input element of field widgets
in editable lists: the inputs were too narrow and offset to the left.

These inputs should now take the whole width of their containing cells.

> Example view: CRM / Configuration / Tags

closes odoo/odoo#98288

Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2022-08-24 17:17:05 +02:00
Michael (mcm) 10402260be [FIX] web: fix text field border style
To compute the correct size of the text field, the vertical
borders are removed and reset after the computation.
The second part was not done correctly and so the
textarea didn't have any border.

closes odoo/odoo#98284

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2022-08-24 17:17:01 +02:00
luvi fbfbcb15fb [FIX] web: remove padding of StateSelection
This commit removes vertical padding of the dropdown
toggler used in the StateSelection field widget converted
to Owl recently. In a list, it was causing an unexpected
 higher row.

closes odoo/odoo#98718

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-23 17:55:44 +02:00
FrancoisGe 211a38b4b0 [FIX] web: ReferenceField with model_field option
Before this commit, if we have a reference field with a "model_field" in
X2many in list mode and we modify this record, then the value of the
reference field is set to false.

Cause of the problem:
The reference field assumes that the preloadedData are always available.

How to reproduce :
- Go to an x2many in list mode containing a reference field with a
 "model_field" already containing a value
- edit another field than the reference
- click outside the record

Result before :
The record switches to readonly mode and its reference field contains
the value false

Result after:
The record switches to readonly mode and its reference field has not
changed value.

closes odoo/odoo#98630

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-23 17:55:28 +02:00
Dardenne Florent (dafl) d3905b5bb7 [IMP] web: improve statusbar widget performance
Purpose:
Improve performance/reduce server load for the status bar widget when
the underlying field is a m2o.

Before this commit:

The status bar widget does two calls:
- a search_read request to retrieve ids and folds
- a name_get to retrieve names

With this commit:

The name_get can be avoided to save a call by fetching display_name in
the search_read.
This commit removes the name_get call to retrieve the name directly
from search_read.

task-2919535

closes odoo/odoo#98164

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-23 17:55:18 +02:00
Matthieu Stockbauer fe699a241d [IMP] *: adapt client code to use websocket instead of longpolling
*: bus, calendar, hr_attendance, iap_mail, im_livechat, project, snailmail,
snailmail_account, survey, web, web_editor, website_livechat.

This commit is part of the websocket integration in Odoo.
This bus service now communicates with a shared worker in order to provide
a single websocket connection for multiple tabs. It is designed to
be used as a websocket except that events are slightly different,
re-connection is handled automatically. If the browser does not support shared
worker (Safari), the service fallback on a simple web worker.

Available events are:
   - connect : fired upon a successful connection.
   - disconnect : fired upon reception of the websocket close event.
     The close code and reason are given to the listeners callback.
   - reconnect : fired upon a successful re-connection.
   - reconnecting : triggered when the worker starts to try reconnecting.
   - notification : fired upon the reception of notifications.

Since multiple tabs are now handled by a worker, the cross_tab bus is no longer
required and has been removed.

Part-of: odoo/odoo#75510
2022-08-23 17:55:10 +02:00
FrancoisGe 4f87c9c07f [FIX] web: switch the record with keynav in FormView
Before this commit, in a formView, if you modify an input and use
the keynav (alt+n or alt+p) to change the record, then the modification
is not saved.

How to reproduce?
- go to a form view with a pager containing more than one record
- edit an input
- press alt+n to move to the next record
- press alt+p to go back to the previous record

Result before:
    The record has not changed

Result after:
    The record has saved the change.

closes odoo/odoo#98602

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-23 16:29:25 +02:00
Bruno Boi fff7334d09 [FIX] web: use right datetime format in daterange field
- First issue
The format passed to the daterangepicker locale options could have been
wrong as the daterangepicker lib uses moment and we would pass to it
the date(time) format expressed with luxon's format tokens.
Furthermore, there was no need to pass the format to the daterangepicker
library as the DateRangeField component already handles this.

- Second issue
There was also another issue with the DateRangeField component:
When applying the daterangepicker values, the conversion between a
moment object to a luxon DateTime object was wrong because of the format
used to convert the moment object to a string.

- Explanation
The format tokens are different between luxon and moment.

- After this commit
An helper function has been introduced in order to transform a luxon format into a moment format.
The DateRangeField component now properly converts a moment object to
a luxon's DateTime object when applying the daterangepicker selection.

- Additional note
Also, the DatePicker component was locally converting the luxon's
datetime format and thus has been adapted to use the new helper.

closes odoo/odoo#98578

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-23 16:29:22 +02:00
Bruno Boi 83719ce376 [FIX] web: make daterange field work with empty initial value
- Before this commit
Using a daterange field with an empty start/end date(time) will result in an unusable field.
The datepickers shown are set with invalid moment.js objects.

- Explanation
A formatted empty value yields an empty string.
Calling `moment("")` results in an invalid moment objet.

- After this commit
When the formatted empty value yields to a falsy value (i.e. an empty string), we call the global moment function without arguments.
Calling `moment()` results in a valid moment object representing the current date and time.
This is what we are looking for, and thus our issue is resolved.

Part-of: odoo/odoo#98578
2022-08-23 16:29:21 +02:00
Dardenne Florent (dafl) 87effdf514 [IMP] web: graph: add group by many2many
The purpose of this commit is to enable the "group by" functionality of
many2many in graph views.
Some other views also implement it (e.g. Gannt odoo/enterprise#20192,
List and Kanban odoo/odoo#74985), it is therefore a logical step to also support group
by many2many in graph views.

Previous behavior:
It is possible to select a many2many in the group by but it has no effect in the graph.

Expected behavior with this commit:
It is possible to select a many2many in the group by and it has an impact in the graph.

task-2721035

closes odoo/odoo#98009

Related: odoo/enterprise#30272
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-08-23 16:29:02 +02:00
FrancoisGe 771fdcc67c [FIX] web: pick a non-enumerable property
Before this commit, pick did not work on non-enumerable properties.

For example, getters in a class are non-enumerable properties. It was not
possible to pick the value of a getter in a Class with the pick function.

closes odoo/odoo#97558

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-23 16:28:58 +02:00
FrancoisGe e1d60b9161 [FIX] web: x2m open form dialog with the correct context
Before this commit, when you want to modify or add a record in a
non-editable x2many, the call to get_views to receive the arch for the
FormViewDialog did not contain a context.

Problem:
The arch of the form view that is received for adding or editing a
record in a non-editable x2many is not evaluated correctly.

Cause:
An empty context is passed to the "get_views" to receive the arch
for the FormViewDialog.

Solution:
We use the context of the StaticList that represents the x2many for
the "get_views".

Part-of: odoo/odoo#97558
2022-08-23 16:28:57 +02:00
FrancoisGe a11dafc99c [IMP] web: add control action button in x2many
This commit adds the possibility to define control action buttons in the
arch of a list view for a x2many. These buttons are action buttons that
will be placed in the same place as the control create ("Add a line").

The goal of this new feature is to offer the possibility to define
buttons that execute actions linked to an x2many.

Here is an example where we define a control create and a control action
button:
<tree>
    <control>
        <create string="Create" context="{}" />
        <button string="Action Button" name="do_something"
            class="btn-link" type="object" context="{'parent_id': parent.id}"/>
    </control>
    <field name="display_name"/>
</tree>

Part-of: odoo/odoo#97558
2022-08-23 16:28:57 +02:00
FrancoisGe b2a0a1c7d3 [FIX] web: ListViewHeaderButton use the correct context
Before this commit, when a ListViewHeaderButton was clicked, the view
context wasn't sent to the server.

As ListViewHeaderButton shows, the onClickViewButton API is not correct.
It expects a record in params but this is not correct in the case of
ListViewHeaderButton. So we decided not to pass a record but a getParams
callback that allows us to calculate the params when we need them.

Part-of: odoo/odoo#97558
2022-08-23 16:28:57 +02:00
Laurent Desausoi (lade) 1e19842303 [FIX] web: allow auto_save when using the keyboard to switch records
When using the keyboard to switch records (e.g.: Leads records), we can use
keyboard shortcuts (ALT + N / P) to travel from records to records. However,
when using these shortcuts, the changes on the current record are not applied
when switch.

Step to reproduce the issue:
1. Install CRM module and activate Lead
2. Ensure that there are multiple Lead already created
3. Go on one Lead and edit its title WITHOUT clicking outside the box
4. Press ALT+N on your keyboard to switch to the next record
5. Press ALT+P to come back to the initial record
You will see that the initial record's changes have not been saved.

Solution: The issue is a racing condition. Somehow, when we use the keyboard
shortcuts, the `mutex.exec` from the `applyChanges` function (cfr. Line [1]) is
not prioritized and the `isDirty` check from `saveChanges` is executed first (
cfr. [2]). We can check this with the debugger, we stop on the `mutex.exec`
then we execute the `isDirty` then we execute the callback of the initial
mutex. The issue is that, it is the callback of the mutex that allows to set
the `_isDirty` flag to True which in return allows the `saveChanges` to
save the record as he spot some changes.

[1]: https://github.com/odoo/odoo/blob/ef789170ce2f1553b325b379aac4452e473de1e9/addons/web/static/src/legacy/js/views/basic/basic_controller.js#L281
[2]: https://github.com/odoo/odoo/blob/ef789170ce2f1553b325b379aac4452e473de1e9/addons/web/static/src/legacy/js/views/basic/basic_controller.js#L180

opw-2824986

closes odoo/odoo#96696

X-original-commit: d9ec7b4b4a9f3cc8caa4c7f5fade8ce1fb8baaea
Signed-off-by: Desausoi Laurent (lade) <lade@odoo.com>
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2022-08-23 15:05:17 +02:00
Christophe Monniez c754838489 [FIX] web: fix clickbot click timeout inconsistency
The clickbot click default timeout was increased in #98495, but missed
the fact that the default was overridden for the "Settings" menu to a
lower value.

With this commit, the "Settings" exception is completely removed as the
default timeout is higher. Also, checking that the text contains
"Settings" was a bit weak.

While at it, the timeout for the global testing of an app is also
increased to 10 minutes instead of 5 as this limit is reached by the
Field Service app.

closes odoo/odoo#98617

X-original-commit: 0247e6f4abef4121b451c1373ae3c1ce184451c0
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-08-23 08:50:01 +02:00
qsm-odoo 1968599a45 [FIX] web: restore default website navbar (BS5 order classes)
Commit [1] broke the default website navbar by removing the generation
of order-XXX-0 classes.

[1]: https://github.com/odoo/odoo/commit/6ed6a512bfec8e2415da2d19304215fcd06273b2

closes odoo/odoo#98609

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-22 20:27:01 +02:00
Laurent Stukkens (LTU) 260def9c6f [IMP] web: support multiple default_period:
Prior to this commit, `default_period` attribute is taking a single value.
This commit adds the support for comma separated values.

task-2941625

Part-of: odoo/odoo#97321
2022-08-22 18:03:13 +02:00
Samuel Degueldre b3ad8d2376 [FIX] web: prevent crash when serializing action button's context
Previously, when evaluating a button's context from its attributes, we
would evaluate it with the record's data as context, this resulted in
x2many fields being evaluated as a datapoint (in particular, as a
StaticList). When we then went to call doAction with that context, the
action service tries to serialize that context with JSON.stringify,
which crashes as the StaticList contains circular references. This is a
mistake, as contexts and domain that are to be evaluated from a
string/attribute should be evaluated using the record's evalContext, not
its data. This commit fixes that.

closes odoo/odoo#98469

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-22 14:01:12 +02:00
Samuel Degueldre 527edcf366 [FIX] web: allow validating column quick creating with enter in kanban
With the conversion of the kanban view, it was no longer possible to
validate the quick-creation of a column using enter while within the
quick-create input, this is because the hotkey service ignores hotkeys
being pressed while within an editable element by default except for the
escape key.

This commit fixes that by configuring the enter hotkey that
is registered to bypass the editable protection, and also restricts this
hotkey to only be active while focused inside the input.

closes odoo/odoo#98535

Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2022-08-22 10:27:23 +02:00
Samuel Degueldre 38e7589042 [FIX] web: prevent crash when mixing hotkeys with and without area
Previously, when registering a hotkey without an area then a hotkey with
area, there would be a crash, as that latest hotkey is the candidate
winner, and we then check that there is no other matching hotkey with an
area that's more specific. In doing this, we assume all other candidates
have an area and call it as a function, but since some hotkey
registrations don't have one, we get a crash.

This commit fixes that by filtering the candidates to only those which
have an area before trying to narrow down to the most specific one.

Part-of: odoo/odoo#98535
2022-08-22 10:27:22 +02:00
FrancoisGe 268c949f89 [FIX] web: create record with x2m invisible
Before this commit, when creating a record containing an invisible
x2many, the fields related to this x2many were not asked during the
creation onchange.

Problem:
Some required values were missing when igniting a new record.

Cause:
The arch related to an invisible x2many was ignored.

closes odoo/odoo#98086

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-22 10:27:07 +02:00
Christophe Monniez 734debfb3a [FIX] web: increase clickbot click timeout
It happens that some pages are exceeding the click timeout of ten
seconds. Notably the settings, and as the settings are linked to
different menu's, it's difficult to black-list them.

closes odoo/odoo#98525

X-original-commit: 26665a5055842a40f3beb718bd63546758f190f4
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-08-20 13:40:36 +02:00
Hubert Van de Walle (huvw) e173961afb [FIX] web: mobile: highlight for selected record in list view
Steps to reproduce:

  - Load odoo on a mobile view
  - Go to Inventory > Products > Products Variants
  - Switch to the list view
  - Long press a record to enter the selection mode
  -> The selected records should be highlighted in blue

closes odoo/odoo#98186

Related: odoo/enterprise#30465
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-20 09:12:53 +02:00