Commit Graph
18260 Commits
Author SHA1 Message Date
mano-odoo e0491c1a62 [FIX] web, mail: increase form view width
Currently the form sheet have a flex-grow-1, the chatter could use less
horizontal space to leave more space for the form sheet's content.

This commit widen the form_sheet by applying a flex-grow-2 and
reduces the chatter's top bar total width by removing the icons and
applying a sup tag on the micro information displayed aside the icons.

Since the icons are removed there is no need to test if the icon is
rendered with it's appropriate text anymore thus we can remove these
two lines. Additionally the `text-warning` on the span was unnecessary
since it's already applied on the button parent. 

task-3641988

closes odoo/odoo#147136

Related: odoo/enterprise#53208
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2024-01-16 22:39:58 +00:00
Mathieu Duckerts-Antoine 3abba287f7 [FIX] web: adapt editFavoriteName helper
With the last realease of owl, .trim now implies .lazy. This means that
if t-model.trim is used, the value will be updated in the state only when
the change event is triggered. Here we adapt the helper editFavoriteName
which was supposed to update the state value.

X-original-commit: 7a16b75a35a5bd60190ee5b437b925a2fa99fb70
Part-of: odoo/odoo#149507
2024-01-16 13:15:22 +00:00
Mathieu Duckerts-Antoine 2f934bc91f [IMP] web: update owl to 2.2.9
We update owl to 2.2.9. Our version was 2.2.7.

Release notes:
https://github.com/odoo/owl/releases/tag/v2.2.8
https://github.com/odoo/owl/releases/tag/v2.2.9

These releases contain small improvements
2.2.8:
    - [IMP] template set config: getTemplate function
    - [IMP] parser: .trim modifier implies .lazy modifier
    - [REF] parser, template_set: factor out parseXML function
2.2.9:
    - [IMP] reactivity: replace sets with small arrays for performance

X-original-commit: 91a1f495b260ab23df80d74faeae25a5883deda0
Part-of: odoo/odoo#149507
2024-01-16 13:15:22 +00:00
miad-odoo 2d5d178403 [FIX] web: fix invoice preview
Before this commit, the `report_invoice_wizard_preview` was rendered well in
html and in the preview (settings page) but not when downloading it ; the
"total" table was pushed all the way to the right.

opw-3648586

closes odoo/odoo#149509

X-original-commit: 232c257c1554f2f47b589a971cdf9f98227ef53c
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Adrien Milis (miad) <miad@odoo.com>
2024-01-16 11:40:03 +00:00
Brieuc-brd 0ef9d5b272 [FIX] web, *: adapt oi-close and corner arrow icons
*: mail, pos_sale, pos_self_order, website_sale

=== `oi-close` adaptation ===
Prior to this commit, `oi-close` icon was based on the default
sans-serif font. Depending on this, there could be alignment and size
inconsistencies with the Odoo UI icon library.

This commit adapts `oi-close` to use a custom icon from the UI icon
library to make it more robust and maintain consistency with this
library.

=== corner arrow icons adaptation ===
Prior to this commit, directional icons related to the four corners were
misaligned.

This commit adapts these four icons so that they are properly aligned.

task-3618046

closes odoo/odoo#144598

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-16 09:55:22 +00:00
Kartik Chavda (kcv) 82c962c665 [FIX] web: set max width on filter and groupby menu
Steps:
- Install planning app.
- Open Planning.
- Click on search bar menu.

Issue:
- The groupBy column width is more than expected.

Cause:
- groupBy and filter menu size changes depending on their
groupBys and filters names so giving bigger name to filters
and groupBy increase their size and there was no max-width
set on then and because of setting name and giving bigger
string on field makes that column unexpectly big.

Fix:
- set max-width on `o_filter_menu` and `o_group_by_menu` to
avoid unexpected bigger size for filter and groupby columns.

task-3607270

closes odoo/odoo#140412

Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2024-01-16 08:23:10 +00:00
bve-odoo 72c1a4f96a [IMP] *: replace type where possible
do not compare types, for exact checks use `is` / `is not`,
for instance checks use `isinstance()`Flake8(E721)

Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-11-07 17:09:34 +00:00
Pierre Paridans 9d920ee859 [FIX] web: control panel create button shouldn't be shown in dialog
The kanban's create button ("New") is usually displayed in the
ControlPanel. But in the select/create dialog (like many2one dialog),
the create button is moved to the footer.

On small screen, the Many2X fields' selection view switches from a list
view to a kanban one but a different condition was used to display (or
not) the create button in the ControlPanel, which explains why the
ControlPanel's create button appears only on small screen (and not in
the same dialog open on desktop-like screen size).

This commit fixes it by reviewing the condition applied in both the list
and kanban views and normalizing them to be based on the (existing)
`showButtons` prop that controls the additional buttons added to the
ControlPanel.

Steps to reproduce (with a smartphone like screen size):
- open Contacts app
- open a contact
- open the company's selection
=> two "New" buttons are displayed (top and bottom)

opw-3431221

closes odoo/odoo#149329

X-original-commit: c21c600189b36b7b4b352f8017467c8ef7d07c87
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2024-01-14 18:05:05 +00:00
Odoo Translation Bot b81790505b [I18N] Update translation terms from Transifex 2024-01-14 00:16:26 +01:00
Jorge Pinna Puissant f468bba9d5 [FIX] web: fix error when no app in clickbot
Since [1], an error is raised when no app is detected on the clickbot.
The issue with this is that it's possible for a user to no have access
to any app. This occurs when we test single apps (web for instance) with
demo user.

The aim of the error is to detect if we are stuck on a tablet mode page.

Now, we change the test on the ensureHomeMenu function, to don't have
false positives, and detect correctly if we are stuck on a tablet mode
page.

Fixes runbot issue 52675
opw-3649047

[1] : 8f365824c9dddacf1b3a40688a30c8498df3d5d4

closes odoo/odoo#149214

X-original-commit: 10475a96401b02b95e92cc6c9eaa909aeb7de1d1
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-12 14:27:48 +00:00
Samuel Degueldre 8f1f32d0fb [FIX] web: improve ListRenderer rendering speed
The ListRenderer disables the checkbox of all lines corresponding to a
record which cannot be selected. Unfortunately, because
`canSelectRecord` is a getter, it is invoked once per line, and this
getter in turns invokes the `editedRecord` getter which scans all record
to find which record is selected. This operation is O(n²), so it's very
slow when there are a lot of records.

This commit fixes that by computing the value once per render.

Time to render the list view of views (technical > User Interface >
views) with 600 records visible:
- before: ~1800ms
- after: ~250ms

closes odoo/odoo#149051

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-11 17:00:54 +00:00
Hubert Van De Walle e660cd94a8 [FIX] web: no_quick_create option ignored
Steps to reproduce
==================

1. Install event
2. Go to Events
3. Configuration > Event Templates
4. Click on any event
5. Click on Communication
6. Add a line, change type to SMS
7. Type anything in Template
8. Click on Create "..."
9. The operation cannot be completed

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

For many2one and many2many editable fields, the server sets the
can_create and can_write attributes on the field nodes. [1][2]

In some cases [3], those attributes are missing even though the fields
are actually editable. They are also absent for reference fields.

The `canQuickCreate` props was set to the following value:
`canCreate && !noQuickCreate`. When canCreate was absent, this was
evaluated to undefined, thus ignoring the noQuickCreate option.

Solution
========

When the permission attributes are missing, we have to assume that the
user has the appropriate permissions.

We also have to cast the extracted props to booleans as if you have an
props with a value of undefined, it will fall back to the default value.

In the test `no_quick_create option on a many2one when can_create is absent`,
we set the field as readonly and then cancel the readonly on the view.
This reproduces one of the bug of [3] which causes the permission
attributes to be missing.

-----

[1]: https://github.com/odoo/odoo/blob/fa6da3d63a3a4cce4e8ca788a49772925d318764/odoo/addons/base/models/ir_ui_view.py#L1296-L1297
[2]: https://github.com/odoo/odoo/blob/fa6da3d63a3a4cce4e8ca788a49772925d318764/odoo/addons/base/models/ir_ui_view.py#L1080-L1086
[3]: https://github.com/odoo/odoo/pull/138032

opw-3609799

closes odoo/odoo#148163

X-original-commit: efcb2a820bb57f1fae809725e799b3145fbbe599
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Antoine Demany (ande) <ande@odoo.com>
2024-01-11 15:16:22 +00:00
Lucas Perais a0db7871ab [FIX] web: useRecordObserver error bubbles
Have a fieldWidget using useRecordObserver. In its callback, have a line that will
throw an error.

Before this commit, the Promise created by the hook was not rejected, leaving the error untreated and
popping until the window's onunhandledrejection event handler.

After this commit, the error appears on the owl errors stack, catchable with the hook onError.

opw-3667395

closes odoo/odoo#148887

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2024-01-11 11:40:25 +00:00
luvi 6872f0a547 [FIX] web: prevent annoying focus on touch devices
This commit fixes an annoying issue when using Odoo on a tablet or a PC when using
the touch screen primarly. The virtual keyboard popped way too much when navigating
in between views and screens, since the focus is often set on inputs (mostly the
search bar with useAutofocus).

Steps to reproduce:
- on a Windows laptop or tablet with a touch screen, open any view
- the virtual keyboard appears
- you must touch out of the keyboard to use Odoo

To fix the useAutofocus hook, hasTouch is now being used instead of relying on the size
of the screen.

Autofocus test with isSmall has been adapted to specify that touch isn't modified, and
that the autofocus is still present. And another test has been added asserting the
behavior on a touch device.

In the form renderer, the autofocus set manually on the first element is now prevented as
well, reducing the popping effect of the keyboard when opening a view. A test has been
added as well.

task-3627697

closes odoo/odoo#148925

X-original-commit: 1f2ab6d5dda61a6aad6e0e9bd282195cdd990f15
Related: odoo/enterprise#54074
Signed-off-by: Romain Estievenart (res) <res@odoo.com>
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2024-01-11 10:06:41 +00:00
mano-odoo a66fe99800 [FIX] web: kanbancard reestablish 16.0 outline effect
Since milk redesign the kanbancard lost their outline bottom on focus
state.

Previous fixes where applied to solve this issue in commit[1]
and commit[2]. These fixes were a Catch-22:
fixing a behavior here, creating an issue there (double borders,
issue on drag..) which lead to more custom code.

In this commit, we remove the code added by the previous fixes and apply
a solution used in version 16.0 and prior. Relying on a negative margin
to hide the border of the following `kanban_record` and applying an
outline effect and a greater `z-index` on focus to make it appear on
top of the border. This z-index is set to 2 to compensate the
`z-index-1` on the kanban column when a card is focused and dragged.

[1]: odoo/odoo@d8fcc218bc
[2]: odoo/odoo@2495bfa725

task-3580229

closes odoo/odoo#148869

X-original-commit: ca388322327379e470e76f3a3c6ee2b2271e3895
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2024-01-11 10:06:38 +00:00
Simon Genin (ges) 2b9717400a [FIX] web: Kanban grouped on field with readonly expression
As a reminder, the readonly expression in grouped kanban can enable or
disable the drag and drop feature. If the view is not reaonly but the
field in the arch on which the view is grouped is readonly, the drag
would be disabled.

Before this commit, there was a regression introduced in commit
ba1a5509fa that made the kanban record not
able to evaluate the readonly expression in the fields.

This commit fixes the issue by making the kanban record evaluate the
provided expression. It does not however correctly evaluate the
expression if it contains another field as the drag and drop feature
can be enabled at a view level, not at a per record level. It would then
resolve to not readonly.

Task id 3611116

closes odoo/odoo#148533

Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2024-01-10 19:39:26 +00:00
Louis (wil) 13bb9c21ab [FIX] *: remove escaped newlines from translated strings
The parser of the library we use to extract strings to be translated
(python-babel) doesn't handle escaped newlines in the same way as the
JavaScript parser. The resulting mismatch makes the content that uses
them untranslatable.

for example:
```js
const hey = _t("slt \
çv ?"
);
```
is exported as "slt \nçv ?", while the content of the variable is
"slt çv?"

This commit removes faulty occurrences from the code base and re-exports
the corresponding POT files.

*: point_of_sale, pos_sale, project, web

closes odoo/odoo#145971

Related: odoo/enterprise#52617
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2024-01-10 15:26:01 +00:00
Lucas Lefèvre (lul) 8a459f1859 [FIX] web: support False for selection in domain selector
The original issue (in saas-16.4) has been fixed in 17.0
by refactorings.

This commit only fw-ports the test

Steps to reproduce:
- Open the Subscription app
- click on the list cog wheel
- Spreadsheet > Insert list in spreadsheet
- Select the blank spreadsheet and insert the list
- right click any cell with a list function
- click on "See list properties"
=> boom `undefined is not iterable (cannot read property Symbol(Symbol.iterator))`

The list domain has the shape `["subscription_state", "not in", ["2_renewal", "5_renewed", false]]`
`false` makes the domain selector crash.

opw 3670344

closes odoo/odoo#148727

X-original-commit: cfdc9c6d62050e3aac4bf18f374e4772ce18a504
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2024-01-10 10:28:16 +00:00
Pierre Rousseau 62cbb20739 [FIX] web: update jsconfig paths
The jsconfig.json file is used by editors to provide autocompletion
but the paths were not updated when it's used in the enterprise
path.

closes odoo/odoo#148725

X-original-commit: c41824c35f26708bece94a6bb507496a259172c0
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2024-01-10 10:28:15 +00:00
FrancoisGe 9118bcb0c6 [FIX] web: Input Field always display the correct value
Before this commit, a Field using the useInputField hook can ignore values
from an onchange in some cases.

Problem:
=======
In order to know if it should apply the value of an onchange on the field's input,
the useInputField hook uses a useEffect which will check if the field is
not dirty (being edited) and if it is not invalid. If it true, it will apply
the value returned by getValue which often corresponds to record.data[fieldName].
By executing getValue, it will therefore start to observe changes in record.data[fieldName]
until the next render. If getValue is not executed then changes applied
by onchange on record.data[fieldName] are ignored because we don't observe record.data[fieldName].

Solution:
=======
Always execute getValue in the useEffect to always observe changes on
record.data[fieldName] and apply them correctly on the input if needed.
(It s a hack but we don't have a better solution for now)

How to reproduce:
================
- Go to a Form view with a field B with onchange and a field A (char field)
- Edit field B (an onchange is in progress)
- Insert a value in the input of field A
- The onchange is resolved with a value for field A
- The value in the input for field A does not change (because the field is in edition)
- Click outside the input for field A (trigger change event)
- Edit field B (an onchange is executed directly)

Before this commit:
    The value returned by the second onchange is not visually applied to
    field A. The old value is still present in the input.

After this commit:
    The value returned by the second onchange is correctly applied to field A.
    Its input contains the value of the onchange.

closes odoo/odoo#148711

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-10 10:28:13 +00:00
Hubert Van De Walle cabba664fd [FIX] web: add new digits type in supportedOptions
The digits option was of type string, but it needs to be an array of two
integers.
We introduce a new digits type to handle that case.
This is used in studio, more info in the enterprise PR.

opw-3614919

closes odoo/odoo#148571

X-original-commit: 6dbf59a9db1a68069df7e922fcab673ce7f7ae5a
Related: odoo/enterprise#53865
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2024-01-10 07:27:02 +00:00
Leonardo Pavan Rocha c6f8b62196 [IMP] web: prevent action swiper from being triggered by fullcalendar
Currently in calendar views in mobile it is possible to create events selecting
the time of the event by dragging. However, in calendar we also have the action
swiper responsible for moving between weeks when swiping close to the borders.
The issue is that when trying to create events by dragging close to the border
will cause the action swiper to trigger a swipe, therefore switching to the
next week. This commit fixes this by adding a swipeInvalid prop to the action
swiper that will be checked during the touch move event handler. If the
swipeInvalid is executed at any move and returns true, the swipe is cancelled.

task-3635841

closes odoo/odoo#148541

X-original-commit: 7772b17f226ddb99060b51d6b337e5f5106b5c25
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Leonardo Pavan Rocha <lpr@odoo.com>
2024-01-10 06:12:28 +00:00
Hubert Van De Walle 796cb061d0 [FIX] web: enable zoom tooltip for ImageField in edit mode
Steps to reproduce
==================

- Set the zoom option on an image field (You can do it with studio
  starting from 16.3)
- Go to a record and hover over the image

=> Nothing happens

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

The tooltip is only displayed in readonly,
but with https://github.com/odoo/odoo/pull/100570 ,
the readonly mode has been removed.
So it only applies for views with the readonly attribute.

Solution
========

Always display the tooltip

opw-3646005

closes odoo/odoo#148534

X-original-commit: e0f9a7eedfb91ea46969490cf261548835844907
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2024-01-10 06:12:27 +00:00
FrancoisGe 3e37dc21d5 [FIX] web: mockWebRead respect the spec of a many2one field
Before this commit, the mockServer didn't respect the unity specification
for many2one fields. When you do a mockWebRead and you want to read other fields
than "id" and "display_name" for a many2one field, the mockServeur ignores
this part of the specification.

The goal of this commit is to ensure that the mockWebRead respects
the full specification for many2one fields.

closes odoo/odoo#148483

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-10 06:12:20 +00:00
Julien Carion (juca) 640af08cad [FIX] web: invisible elements should not be considered tabable
This commit ensures that elements returned by the getTabableElements
method of the ui utils does not return invisibe elements. This fixes an
issue with the trapFocus method of the ui service which could set an
invisible element as lastTabableEl therefore making it impossible to
loop back to the firstTabableEl when the actual last tabable element is
focused and the client presses tab. Also fix a side effect of these changes
in list renderer where focusCell would be called before the cell width
computations which would work by chance before since getTabableElements
took into account elements with 0 width but is now no longer the case.
This is fixed by moving down the onPatched method which calls focusCell
underneath the useEffect method which performs column style computations.

Steps to reproduce:
- Go to any dialog with mail installed
- Press tab multiple times
- At some point, the address bar should be focused instead of the dialog
buttons

Explanation: the chatter is present in the DOM but not displayed so the
last tabable element that is detected by getTabableElements is a child
node of the chatter which cannot be reached.

OPW-3584847

closes odoo/odoo#148382

X-original-commit: c631bf09b927003edc4c2b85e8790e8e2e8c044a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Carion (juca) <juca@odoo.com>
2024-01-10 05:04:33 +00:00
Xavier ALT 6633a1102f [FIX] web, survey: fix js 'translation error' for databases upgraded to 17.0
When a user connects to its database that has been freshly upgraded
to 17.0 database, he gets the following JS crash:

```
TypeError: can't access property "defineLocale", moment is undefined
    @http://www.odoo.test/web/webclient/locale/fr_FR:13:10
    @http://www.odoo.test/web/webclient/locale/fr_FR:9:4
    @http://www.odoo.test/web/webclient/locale/fr_FR:10:2
```

Before 17.0, the `/web/webclient/locale/<string:lang>` route was used
to get the appropriate `momentjs` locale and was cached for a duration
of 1 week.

So when connecting to the upgraded database we will get the cached
file, but as `momentjs` has been removed (see odoo/odoo@4327c062d8)
it will crash.

Now as `luxon` is using browser's `Intl` to get the translations, we
can safely remove the call to that endpoint (it will always return an
empty file anyway)

closes odoo/odoo#145733

Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2024-01-09 23:04:41 +00:00
Aaron Bohy ac40c6eabb [FIX] web: x2many with non inline form: don't share active fields
Before this commit, the StaticList and its Records shared the same
reference to the activeFields. When an x2many record was opened in
form view (and that form view wasn't inline), we altered the active
fields to add the information coming from the form, and we loaded
the corresponding data for the record we open. However, by doing
so, we also altered the active fields of all the other records,
for which we didn't load the corresponding data. From that point,
a rendering of those kanban records could lead to a crash, because
we iterate over active fields and make the assumption that there's
an entry for each of them in data, which isn't the case.

For instance, this happened in a dev branch in project, in mobile:
after opening a sub task in form view, if we switched to another
notebook tab and then switched back, there was a crash.

This commit fixes the issue by creating a copy of activeFields for
each Record, s.t. when a record is opened in a dialog, only its
activeFields (and those of the StaticList) are altered.

Note that activeFields of the StaticList must be altered in this
case to ensure that the onchange spec is properly generated, with
the fields of the form view.

closes odoo/odoo#148351

Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2024-01-09 06:27:58 +00:00
Aaron Bohy 2005c38679 [FIX] web: view compilers: use compiler in cache key
Before this commit, the key for the cache of compiled templates
(in the useViewCompiler hook) only relied on the arch, i.e. we had
a cache hit if we had to compile an arch that had already been
compiled before.

However, the Compiler to use might change. When this happens, the
template must be re-compiled, obviously, as the ouput may differ.

For instance, have a kanban arch with a js_class (pointing to a
custom view with a custom compiler), and have that arch used in an
x2many (where js_class is ignored, i.e. where it is rendered with
the basic kanban renderer). This happens in project, with the task
kanban view, which is also used for the child_ids field, in the
task form view.

This could lead to traceback, as the compiled template might refer
to attributes of a the KanbanRecord that only exist on the custom
KanbanRecord, not on the basic one.

Part-of: odoo/odoo#148351
2024-01-09 06:27:58 +00:00
Chrysanthe (chgo) 40c183f6d9 [FIX] web: fix missing border-radius on arrow button
This commit fixes an issue about the last arrow button not taking the
`o_first` class  in some cases.

With Odoo 17, we introduced a new behavior for our arrow buttons.
This behavior includes an invisible element placed before and after the
first arrow button on the left and right side.

While this is working fine as long as you don't have any hidden item
insie a dropdown menu, once you trigger a stage that was folded into a
dropdown menu, this invisible element appears on the right side.

Since we use the `o_first` class that sets a `border-radius` on the first
element on the right side, this invisible element was taking that
`o_first` class.

To fix the issue, we search for the first element within the scope that
does not have a `d-none` class, and we then add the class to that specific
element.

task-3628288

closes odoo/odoo#145453

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-08 19:12:45 +00:00
luvi d416afca3d [FIX] web, *: fix supportedOptions in some fields
*: analytic, mass_mailing

This commit fixes the supportedOptions object in some fields. Instead of using
a 'supportedTypes' key when descbribing the type of fields that an option must use,
the 'availableTypes' key must be used. This was simply misspelled.

A help has also been added for the fold_field option, following the fix for task-3474817

closes odoo/odoo#143127

Related: odoo/enterprise#51241
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2024-01-08 11:40:32 +00:00
luvi 507d420e9f [FIX] web: fix crash when adding more state selection options
Since the StateSelectionField component handles the hotkey registration,
it was necessary to verify that an hotkey can effectively be added, instead
of trying to register to alt+undefined.

This issue happens when having more options in the selection field. Since the
code is written in a way each listed option should have an hotkey associated,
which is not the case, because the list of supported hotkeys has a length of 3.
The command is then added, without an associated hotkey.

A simple test case has been added, using the hotkey to set a state, and asserting
the presence of more than 3 items in the dropdown.

opw-3620129

closes odoo/odoo#148343

X-original-commit: ab572de20367f67aab4092b9e600e5ebd4cce4a6
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2024-01-08 07:21:52 +00:00
Odoo Translation Bot 0e23020b84 [I18N] Update translation terms from Transifex 2024-01-07 00:23:19 +01:00
Martin Trigaux 9a666bc8f0 [I18N] *: export 17.0 translations
There were a few errors

closes odoo/odoo#148315

Related: odoo/enterprise#53724
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2024-01-05 15:14:38 +00:00
Mahdi Cheikh Rouhou (macr) e05dbe37e5 [FIX] web: show the name fully in signature sign item
Issue:
======
The auto signature has hidden overflow part in y axis when having long
characters in bottom like (y, j, g)

Steps to reproduce the issue:
=============================
- Use any sign template that have at least one name_and_signature sign
  item.
- Enter a name that have at least one of the characters (y,j,g)
- Click on auto
- The signature doesn't show fully

Solution:
=========
Update the hardcoded values for the y-axis for the name and the line of
signature and the font size to make sure it fits perfectly inside the
canvas.

opw-3639171

closes odoo/odoo#148299

X-original-commit: c9653d5649a35640cc461c9baa0b73e8c6c1cace
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-05 15:14:36 +00:00
Aaron Bohy c821460f93 [FIX] web: pager hook: allow to combine useSubView to patch config
Before this commit, the pager hook use useChildSubEnv to patch the
config with the pagerProps. We used useChlidSubEnv because this
information only targets one of its children (the ControlPanel),
not the components using the hook themselves (e.g. the controllers).

However, this has an infortunate side-effect. If a component using
the pager hook also wants to patch the env (e.g. with useSubEnv),
and does it after calling usePager, it will erase the sub env
created by the pager hook for the children by its own.

This happens with the TimesheetTimerListView:
```js
    setup() {
        super.setup(); // super will call usePager
        useSubEnv({
            config: {
		// this config doesn't contain the pagerProps
		// generated by usePager, as it's the config of
		// the component itself
                ...this.env.config,
                disableSearchBarAutofocus: true,
            },
        });
    }
```

Since using useChildSubEnv in this case isn't necessary, we simply
replace it by useSubEnv.

Note that we don't add a framework test for this issue, as it
would be totally artificial. Instead, the enterprise PR adds a
test for the TimesheetTimerListView.

opw 3636182

closes odoo/odoo#147393

X-original-commit: 8dbf8021842b94b9b067e2582f3aa92d31ef62e5
Related: odoo/enterprise#53342
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-05 15:14:32 +00:00
FrancoisGe e0109a99f8 [FIX] web: header button with display="always" and invisible
Since the commit odoo/odoo@0d99f4b9d9, the header buttons with display="always"
can't be invisible. The invisible attribute is ignored for this type of
button in list view and kanban view.

This commit fixes this issue by adding t-if that will evaluate the invisible attribute.

closes odoo/odoo#148092

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-05 08:00:41 +00:00
FrancoisGe da358cfc1f [FIX] web: add autocomplete attribute to the email input in login view
Before:

In chrome, you can see the message "[DOM] Input elements should have
autocomplete attributes (suggested: "username"):
(More info: https://goo.gl/9p2vKq)".

After:

The message does not appear.

Also, This maintains consistency with the password input which has the
attribute autocomplete.

closes odoo/odoo#147971

X-original-commit: df53b6a842f6eecc699ea9d8625c918279bb22c6
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2024-01-04 12:02:03 +00:00
FrancoisGe d61829f9a2 [FIX] web: close dialogs on navigation command
Before this PR:
Previously, when the command palette was opened and a navigation command
("/") was being executed with single or multiple dialog boxes behind it,
only the command palette would close. This left the dialog boxes open.

After this PR:
Now, when a navigation command ("/") is being executed from the command palette,
all the dialog boxes and the command palette close simultaneously.

Task-3441132

closes odoo/odoo#147956

X-original-commit: 7b32b235ec488d347285a9f47aa9d4b04b0b186c
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-04 12:02:02 +00:00
Julien Castiaux 2a8dd60118 [FIX] core: HTTP 413 when restoring large backups
In #126914 a limit on the request size has been enforced, that limit is
by default 128MiB and can be configured via an ir.config_parameter. When
restoring a backup larger than 128MiB via the database manager, the
default limit was used and the request was cancelled with a Request
Entity Too Large (code 413) HTTP error.

It is now possible to define a default max content length per route,
that per-route limit takes over the `web.max_file_upload_size` ICP.

Moved the code from `get_http_params` to `pre_dispatch` to better align
with the httpocalypse new http stack.

Fixes: #144144
opw-3643475

closes odoo/odoo#147506

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2024-01-04 12:01:59 +00:00
Manushi Shah (mash) de8d3deeae [FIX] web: displaying price on product stat button
Steps:
- Open Field Service
- Create a new task
- At first, the product stat button shows the price as 0.00
- Add task name and customer
- Save the task.
- Check product stat button

Issue:
- Now, after saving the task, the product stat button will not have the price
shown as it was displayed before.

Cause:
- The class o_field_empty is applied which has the property of display: none
and hence the price field is not displayed.

Fix:
- The o_field_empty class is applied at the wrong place, we need to apply the
o_field_empty only when o_stat_text is applied.

closes odoo/odoo#147926

Task: 3394985
X-original-commit: 9ea49b1e0be064ef4dd7dafe05aff4bd742ac135
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-03 18:06:00 +00:00
Manushi Shah (mash) 7e9563bb77 [FIX] web: rectify alignment of worksheet template
Steps:
- Open Field Service
- Switch to the calendar view
- Click on any task
- Notice the space in the row of the worksheet template

Issue:
- There is a weird space between the title Worksheet Template and the template
name

Cause:
- Due to the long name of Worksheet Template, it moves to the next line but
occupies a certain amount of space around it

Fix:
- By giving flex-wrap, the content is displayed properly

Task: 3394985

Explanation:
When the label 'Worksheet Template' is long and moves to the next line without
flex-wrap, it may cause unwanted spacing issues. By using `flex-wrap: wrap`,
you essentially enable the content to flow onto a new line if it exceeds the
available width, ensuring a more visually appealing and properly aligned
display without unnecessary space around the label. It allows for a more
flexible layout, accommodating varying content lengths without compromising
the overall presentation.

closes odoo/odoo#147925

X-original-commit: 9be92729eaa4bc3b3cfe9778cb2b1fcc47a8cc59
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2024-01-03 18:05:59 +00:00
Hugo Carlier (Huca) bc98aad620 [IMP] web: add always_range option to daterange widget
always_range option on the daterange widget allows to always display this
widget as a range (two inputs separated by an arrow) even if both
start/end date are empty and not required.

task-3628069

Part-of: odoo/odoo#145167
2024-01-03 10:58:02 +00:00
Chrysanthe (chgo) c04d667912 [FIX] web: allow radio fields to wrap horizontally
This commit adds the possibility for the `.o_horizontal` class to wrap,
which is especially interesting in mobile.

When using a `radio` widget, you can choose to use two options :

- `horizontal` which will add a `.o_horizontal` class to the radios
and allow them to display with a `flex-row`

- `vertical` which will add a `.o_vertical` class to the radios
and allow them to display with a `flex-column`

Prior to this commit, the `.o_horizontal` class was not allowing elements
to wrap, which would cause overflow issues on small devices.

To fix this issue, we add a `flex-wrap` property to the class, to ensure
that if the buttons are larger than the breakpoint, they will wrap
and stay inside the container.

task-3580082

closes odoo/odoo#140651

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2024-01-03 10:58:00 +00:00
Paolo Gatti (pgi) a0741f6427 [IMP] web: Settings default search context key
The Settings page lacks a default search context key, because it lacks
the `<search>` arch.
We add a context key to make actions target some settings.

closes odoo/odoo#147149

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2024-01-03 09:17:50 +00:00
Prakash Prajapati f1654683b6 [FIX] web: fix the test case related to the year
Before this commit, since we are no longer in 2023, the test failed
because there is no longer 2021 in the filters dynamically added in the
dropdown of the date filter. The reason is now we have the current year,
the previous one, and the one before, that is, 2024, 2023, 2022.

This commit adds a patchDate to be sure we will start the test in 2023,
to get the expected filters displayed (2023, 2022, 2021).

closes odoo/odoo#147809

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-01-02 16:09:51 +00:00
Odoo Translation Bot ad35458e8b [I18N] Update translation terms from Transifex 2023-12-31 00:18:24 +01:00
Anh Thao Pham (pta) 78cbdc604e [FIX] web: fix checklist and blockquote style in report
Steps to reproduce:
- Go to Sales and create a quotation
- In "Terms and conditions" field, add a Checklist and a Quote,
using "/" command
- Print the quotation
=> Checkboxes are replaced by bullets and blockquote has no style.

Solution:
For blockquote in reports, use the same style than web_editor:
https://github.com/odoo/odoo/blob/b2fa69202c6b3ab677973643711ccd561a2edaea/addons/web_editor/static/src/scss/web_editor.common.scss#L648-L654

opw-3349082

closes odoo/odoo#147619

X-original-commit: 8d069bb036dea9b0fa68e89a8a1886424b6fcc46
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Anh Thao Pham (pta) <pta@odoo.com>
2023-12-27 20:54:10 +00:00
tsm-odoo 56a10b4536 [FIX] mail: fix non deterministic steps in qunit tests
Several tests are non deterministic because they are using
`assert.verifySteps` at the wrong moment. Helpers such as
`afterNextRender`, `nextTick`, `Deferred` are used but those are
either not reliable or cumbersome to setup.

This PR introduces an asynchronous API on top of
`assert.step`/`assert.verifyStep`. This will wait until steps are
executed or until the timeout is reached.

fixes runbot-52660,54471,52794

closes odoo/odoo#147455

Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-12-27 12:38:45 +00:00
Romain Derie cb1ad42130 [FIX] website: make anchor links work in offcanvas mobile menu
A anchor menu in the mobile offcanvas related to an element in the
current page doesn't work in offcanvas:
- The offcanvas doesn't close
- The page doesn't scroll to the clicked location

This is because the menu anchor navigation is hooked to use our own
scrolling behavior instead of the browser one.

Doing so, we preventDefault, which prevent the offcanvas menu to close
itself when clicking on a anchor menu.

This commit simply manually closes the offcanvas and once the closing
animation is complete, starts our own smooth scrolling.
It also targets the desktop offcanvas menu (when hamburger layout is
selected) so it got a smoother UX: it closes then scrolls, instead of
scrolling but not closing.

Another possibility would have been to just close manually the offcanvas
without a preventDefault and without a call to our custom scrolling
method.
Doing so, the browser would naturally scroll to the element while we
close the offcanvas but it would be less elegant as you wouldn't see the
scrolling animation.

Note that the offcanvas was introduced with commit [1].

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

opw-3604963

closes odoo/odoo#146907

X-original-commit: db881e66785a866319bd4980a9ae7b6393e55457
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-12-26 08:36:44 +00:00
Romain Derie 9e8651d5e2 [FIX] web, test_lint: regroup bootstrap globals
A later commit will add `Offcanvas` as new bootstrap global in the
eslintrc files.
Since the globals are randomly sorted, the chance is taken to regroup
those.

Part-of: odoo/odoo#146907
2023-12-26 08:36:44 +00:00