Commit Graph
14680 Commits
Author SHA1 Message Date
jpp-odooandGuillaume (gdi) ad131c6187 [FIX] web: Settings headers should not be dirty
When a user changes a header setting, the record should not be marked as
dirty. If the user clicks on a button, the save dialog should not be
shown.

Next commit will bring a functional test and "steps to reproduce" of
this issue in website.

task-3265100

X-original-commit: 1a64fd83f8be677b76ad97a11928859c63709972
Part-of: odoo/odoo#126387
Co-authored-by: "Guillaume (gdi)" <gdi@odoo.com>
2023-06-26 22:15:17 +02:00
qsm-odoo 41b3e0f1c0 [FIX] web: properly listen to colorpicker drag events
With [1] and [2], the colorpicker / colorpalette were implemented. In
both cases, for the custom colors hue / saturation / lightness selection
we listened to mousemove/mouseup events on the whole body / document.
That is to be able to start dragging the color cursors from inside the
colorpicker to anywhere on the screen (the cursor being confined into
their own box of course).

Problems occur when iframes come into the equation. Indeed, from that
moment, listening to mousemove events on an unique document is not the
way to go as mousemove over inner iframes will be ignored. This should
not be the case anywhere in 15.0 (that this original commit targets).
The only iframe there should be the mass_mailing one and in that case,
the colorpicker is inside the iframe so it should not be a problem.
However, [3] (then fixed by [4]) were meant to tackle a similar problem
(although [3] seems to say the goal was to ignore mousemove outside the
iframe which is the opposite of what this current commit tries to do:
listening on the whole screen). However, by doing so, a memory leak was
created as the document on which the events were bound was not properly
cleaned as the `destroy` which unbinds the events was not adapted. That
is the main reason why this commit targets 15.0 (although, the solution
here still makes sense generically in 15.0 and should make the code
simpler and easier to understand).

In 16.0, however, the iframe situation is a problem: the website builder
colorpickers are now in the main document but the edited content is
inside an inner iframe. In that case, listening to the main document's
mousemove/mouseup events makes the colorpicker only work when not
hovering the edited content (which could be acceptable but not perfect).
Note that during that website builder refactoring, [5] worsened the code
of [3] and [4] to do exactly that. Later, [6] was made to solve an
unrelated problem and actually woke up that worsened code, not
understanding what the new undocumented `ownerDocument` option was for
(it will stay like this in stable from now on, as it will be not used
anywhere anymore... hopefully). Because of that, the situation became
the opposite: dragging inside the colorpicker did not work until the
edited content was hovered. And because of that functional fact, an even
more visible problem was created:

- Click on a snippet
- Select a custom background color using the hsl selection
- Hover a non custom color (like nearly always the case "by mistake"
  after configuring a custom color, your mouse just moves over the non
  custom colors) => your custom color is lost

This was because the chain of events that were listened inside the
colorpicker were gone (because of the combination of [5] and [6]). In
the end, this only revealed the shortcomings of the implementation in
[1], [2], [3] and [4]: we should not try to search which frame we have
to listen to: we should listen to the whole screen. This commit solves
the issue by listening to the top window document and all its inner
iframes, also fixing the memory leak mentioned earlier.

task-3332711

[1]: https://github.com/odoo/odoo/commit/29f0c0a186a9a60d6e5b7f026c305d689b6fc807
[2]: https://github.com/odoo/odoo/commit/99910b526ed792235a778863b993d10cf4e77cd7
[3]: https://github.com/odoo/odoo/commit/4fb33f7f8d6955a44fbb7c94c7d204e9baa09707
[4]: https://github.com/odoo/odoo/commit/f1b26335a286a47f685b7830db97c21e6fefd68b
[5]: https://github.com/odoo/odoo/commit/03c552690b15cbf2e7d6b7812386ac64042219af
[6]: https://github.com/odoo/odoo/commit/418c1178301e28b4bd1412da6d0558e219060830

closes odoo/odoo#126313

X-original-commit: e03158e6da45d83c977b7cf51f0f998343dc6fd6
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-06-26 21:09:55 +02:00
qsm-odoo 10a58341c9 [IMP] web: bind colorpicker events in start instead of init
It is more conventional to bind extra events in the `start` of widgets
instead of in their `init`. Indeed, the handlers often make sense only
if the widget is already in the DOM.

Related to task-3332711

Part-of: odoo/odoo#126313
2023-06-26 21:09:55 +02:00
Kartik Chavda 8a7bf14fbb [FIX] web: fix new line in confirmation and alert dialog
Steps:
- Install studio.
- Open studio.
- Click on reset default view.

Issue:
- Confirmation dialog body display in single line instead in
multiple lines same thing happens in pos confirmation dialog
also in new friendly message task we need to display error
message in multiple line.

Cause:
- There is a style missing on body of that dialog to preserve
white spaces also need to use other tag then <t> to apply
proper style

Fix:
- Use <p> tag instead <t> tag and add a `text-prewrap` class
in bootstrap utility class and use this class in `<p>` to
preserve space.

task-3356114

closes odoo/odoo#125300

X-original-commit: 700d41d2f007124390b7cafca0a2e58a467e2b43
Related: odoo/enterprise#42842
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-06-26 18:24:49 +02:00
Pierre Pulinckx (pipu) 28e1e61e5c [REF] web, pos, website_slides: Remove totally underscoreJS
After this commit, underscore library is totally removed.
Library calls has been removed from manifests.
Library files has been deleted.
This commit closed the task below.

task-3246238

closes odoo/odoo#125889

Related: odoo/design-themes#662
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-06-26 15:11:55 +02:00
chrysanthe(chgo) 4833bc84fb [IMP] web: improve property fields modal design
The purpose of this commit is to improve the design of the Property field
modal as it was done to release something fast.

We also introduce a modification of the JS test related to the property
header. Before this commit, the structure of the modal was composed
of a header and a body.

Since we refactored the component in one single block with the class
`.o_modal_container`, we apply the `.o_field_property_definition_header`
class directly on the input rather than targeting an input inside the
header.

task-3084756

closes odoo/odoo#126274

X-original-commit: 12a25449d9f26aec5f14482952ca0db40bf612b9
Related: odoo/enterprise#43091
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-06-26 13:20:51 +02:00
Antoine (anso) 0a96f3b007 [FIX] web: notification button padding
Removing ps-0 class that was breaking the default button padding

To deal with the possible aligment issue when `btn-link` is used
alone (as this button style has no background), we are switching the
second possible type of buttons to `btn-secondary`. It also matches
with the `btn` combinations used in modals

closes odoo/odoo#126246

X-original-commit: 16237b7ee064a4a7047d0eb6d58a477b048daf67
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-06-23 18:00:15 +02:00
Brieuc-brd 0fba13ed0f [FIX] web: search panel: long filter on mobile
Prior to this commit, when a filter or a dropdown item had a long name,
the layout was broken on mobile, the item went out of the viewport and
wasn't readable.

This commit fixes this issue.

task-3378207
Part of task-3326263

closes odoo/odoo#126071

X-original-commit: 96d1edcdba78af3572c3395867e561c0eb3d5054
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-06-23 16:35:25 +02:00
Géry Debongnie 9f6ed9f6d1 [IMP] web: display empty screen when switching app/menu
The goal is to provide a better feedback to the user, especially in
mobile mode. With this commit, when switching menus, we clear the screen
and display an empty control panel (only for act_window actions though)
so we have some initial content that get filled as soon as the
view/action is ready.

Task 2900847

closes odoo/odoo#124068

Related: odoo/enterprise#43038
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-06-23 16:35:15 +02:00
Laurent Smet 592f0df7e2 [IMP] web: Add hook to provide options to the useModel function on kanban
Task: 3193121
Part-of: odoo/odoo#119185
2023-06-23 16:35:01 +02:00
Laurent Smet e7cbd26b08 [IMP] web: Add hook 'onWillStartAfterLoad' on useModel
Allow a custom onWillStart but after the loading of the model in useModel.

Task: 3193121
Part-of: odoo/odoo#119185
2023-06-23 16:35:01 +02:00
Laurent Smet c6b4f67238 [IMP] web: Add hook on monetary_field
Add an hook to add a custom behavior when parsing the monetary amount written by the user on the UI.

Task: 3193121
Part-of: odoo/odoo#119185
2023-06-23 16:35:01 +02:00
Tiffany Chang (tic) 15e0661151 [FIX] web: correctly parse python field domain
PR odoo/odoo#115197 refactored how a field's domain is read.
Unfortunately it removed the ability to use a domain with python code in
it which can lead to a "Invalid domain AST" client error since it is no
longer parsed correctly.

Steps to reproduce:
- Install mrp_workorder and quality_control
- Open Quality app
- Quality Control > Control Points > New
- Click on `product_ids` field

=> Error is thrown. Issue is due to `product_ids` domain being python
dependent (i.e. if specific record value is set => use one domain,
otherwise use other domain):
https://github.com/odoo/enterprise/blob/d2b0eacd68d6558aa9376985a72a350e20d7619d/mrp_workorder/models/quality.py#L101

which isn't correctly parsed into an AST and which results in this call
throwing the "Invalid domain AST" error
https://github.com/odoo/odoo/blob/75c71ccfa8b5daa79f82af1e492831c565ee54f3/addons/web/static/src/views/fields/many2many_tags/many2many_tags_field.js#L153-L154C13

Note that the type check is needed because sometimes the domain is
passed as an array and other times as a string and we should only
evalExpr on strings. Also for safety we ensure that we do not pass an
domain of "undefined" as well.

closes odoo/odoo#126089

X-original-commit: ffd4ee838cfddb366aa9aafa2f2d92d9a434569e
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-06-23 10:27:53 +02:00
Xavier Luyckx (xlu) ed9fdcf64f [FIX] web: btn-group, allow gap control
Before this commit, due to the milk design, there was a gap between the
buttons in btn-group. However, in certain modules, it was necessary to
have a negative margin-left to achieve an edge-to-edge appearance.

To address this issue, I introduced a CSS variable called
--btn-group-gap to control the margin-left property for the elements.
This change allows for customization of the margin-left value, with a
fallback value of $btn-border-width by default, when needed.

task-3336458
part of task-3326263

closes odoo/odoo#126068

X-original-commit: 1a82e8e80745d26b8c96cd5bf0c10f14b793d440
Related: odoo/enterprise#43001
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-06-23 10:27:45 +02:00
thsh-odoo 05a584806d [IMP] web: adapt the kanban "Remove" button label
Remove button is shown when the view of our field is in kanban mode.

When our field is one2many it will delete the record and when our field is
many2one it will remove the record.

So many times user get confuse that they are deleting the record or removing
the record.

So to clear out the confusion this commit changes the label of remove to
to delete if the field is one2many.

A test was added to ensure this ux change.

Task-3185967

closes odoo/odoo#126112

X-original-commit: 008f3e792bd377499fdac5b16de356f9e03b230f
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-06-23 09:21:02 +02:00
Arthur Detroux (ard) 4d7da09779 [FIX] web: mitigate navigation error on iOS/iPadOS devices
Ever since iOS 16.4, going back and forth through a website with the
cache enabled, creates an error in the console which Odoo tries to
handle but fails to do so. Therefor a generic CORS error message
appears.

There is unfortunately no proper way to fix this bug on our end so
instead, this commit tries to mitigate the error by returning early and
not showing the traceback dialog.

I (ARD) have submitted a feedback through Apple's Feedback Assistant app
and will subsequently remove this commit when Apple releases an update
that fixes this.

opw-3281727

closes odoo/odoo#126094

X-original-commit: ff78ee498fe858e2564262df13600c64a4e2f418
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-06-22 19:37:26 +02:00
Pierre Rousseau 9c954de941 [FIX] web: correctly handle errors in action service
Before this commit, an error triggered in an action (with target=new)
was caught twice: the promise is rejected, and in the case of an
action with target=new, the error is re-thrown.

This caused the error to be caught twice, and the error message to be
displayed twice.

The issue is not visible when the view in the action is a form view
and the error is an RPC error because the error handler decide to do
nothing with an error which is already handled. It's because the form
view uses legacy rpc, which uses a custom error handler.

This commit fixes the issue by not re-throwing the error in the case
of an action with target=new, but only closing the dialog, which was
the reason why the rethrow was done (0cec54b92c).

closes odoo/odoo#126013

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-06-22 19:36:52 +02:00
Julien Carion (juca) 73a9154be8 [IMP] web: add ctrl+enter shortcut to dialogs
This commit adds the ctrl+enter shortcut to dialogs which will trigger
a click on the first visible button in the dialog's footer.

Task-3369676

closes odoo/odoo#125330

Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-06-22 18:29:38 +02:00
Pierre Masereel 2d7db2d441 [FIX] web: keep compatibility for btn-fill
The class btn-fill has been move from the common bootstrap review and
only set in frontend. So we add the class in the backend to keep the
existing HTML fields containing btn-fill- class correctly working.

As there were small differences btween btn and btn-fill, we only use the
same design.

Since the classe btn-fill has been moved to only

closes odoo/odoo#125966

X-original-commit: 8ffc79624eef80d3dfdb9ad38c6faea1187a3b70
Signed-off-by: Pierre Masereel (pim) <pim@odoo.com>
2023-06-22 17:10:39 +02:00
Julien Carion (juca) 2a37a3d06f [REF] web, base, mail: move res.users.settings from mail to base
This commit moves and adapt the res.users.settings model from mail to base and
and allows to access and modify its content with web's user service.
This allows to access user settings without needing the mail module.

closes odoo/odoo#116005

Related: odoo/enterprise#38360
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-06-22 15:40:43 +02:00
Julien Mougenot 23e0ac2a1a [IMP] web: Support pointer events in draggable
This commit:

- adds a "delay" parameter to the `draggable_hook_builder`, waiting for
that delay on pointer down events before triggering the drag sequence
(making it possible to use "long mousedown" events);

- changes the event detection in `draggable_hook_builder` to listen
for pointer events instead of mouse events, effectively supporting the
drag and drop feature on touch devices;

- adapts the test helpers (with some refactors to `triggerEvent` and
other utility functions) to make them use pointer events instead for
drags and drops;

- adapts the tour utils to use a tone-downed version of the refactored
test utils `dragAndDrop` function;

- also changes events in list view which does not yet uses the draggable
hook, but should still work with the same helpers in tests.

Part-of: odoo/odoo#116005
2023-06-22 15:40:43 +02:00
Mathieu Duckerts-Antoine 876a82b299 [FIX] web: distribute ! or not
When the domain selector is in debug mode (props.isDebugMode = true),
the operator ! (not) is not distributed in the leaves in the domain
selector. That is a domain like ["!", "|", ("foo", "=", 1 ), ("id", "=", 2)]
will be visualized in the domain selector as

Match records with none of the following rules:
  Foo = 1
  ID = 2

The problem we fix is that when such a domain is added via "Add Custom
Filter" (for instance), the search bar facet produced has a representation
of the domain where ! has been distributed even if the debug mode is
active. With the previous example:

------------ -----------
| Foo != 1 | | ID != 2 |
------------ -----------

This makes the user think that the domain she sees is not the domain
she has created.

In the present commit, we make sure that the ! operator is distributed
or not uniformly within the scope of the search model.

closes odoo/odoo#125967

X-original-commit: d15d7e13be0ca6f7705c3bb6f992b45949bccef0
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-06-22 09:50:31 +02:00
MerlinGuillaume 08e2409afe [FIX] web: reposition popover when image is loaded
When hovering over an employee's photo (without edit rights) and the
image hasn't been loaded in the cache, the popover is positioned to the
right of the image. With a big image, the popover can be outside of the
page.

Steps to reproduce:
1. Install Employees and set a 4k image to any employee
2. Remove all the rights of Marc Demo on Employees
3. Connect as Marc Demo
4. Open the form of the employee with the 4k image
5. Hover on the employee photo
6. The image position is off

Solution:
Update the position of the popover when the image is loaded and restrict
the image width in the popover to the popover width

Problem:
When we try to find the best position to display the popover and the
image is not loaded, we will find that there is some room for the
popover on the right because the image has no height or width

opw-3281649

closes odoo/odoo#125951

X-original-commit: 532c4cfa4e60bc95319b774794680eabc80b1219
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2023-06-21 20:10:31 +02:00
Hubert Van de Walle (huvw) f15807b787 [FIX] web: refocus date field in editable list
Since [0], when a cell is already focused, we do not refocus again.
But we forgot to set the lastEditedCell to the current one.

The test "editable list view, should refocus date field" has also been
fixed to reflect the actual behaviour. We set the focus on the picker
cell. Before, in the test, it was on the body. This means that in [1],
`this.activeRowId` would be set to null, thus, the test was not failing.

[0]: 437edce313
[1]: https://github.com/odoo/odoo/blob/1ecfd4ee9529a3cd21a925c1e850e10fe05f2097/addons/web/static/src/views/list/list_renderer.js#L116-L117

opw-3332809

closes odoo/odoo#125301

X-original-commit: 5ee1532bdbdde0062a13e75d85f7342eb2447415
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Abdelouahab Laaroussi (abla) <abla@odoo.com>
2023-06-21 13:46:00 +02:00
stefanorigano (SRI) b0baac6fc4 [FIX] web, mail: Dropdown and PopoverWowl, increase contrast
This commit adapt several components and utility-classes in order to
increase visual contrast.

In the case of `o-mail-ActivityGroup` and `o-mail-NotificationItem`
templates, these has been reworked in order to use default BS components
and consequently automatically inheriting the improved design.

task-3338419

closes odoo/odoo#124903

Part-of: task-3326263
X-original-commit: 190ec1c947e17b2b4aa8614e9e0a04d00cb38d90
Related: odoo/enterprise#42507
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-21 00:13:49 +02:00
stefanorigano (SRI) 3168ae5fcc [FIX] web: Dropdown, adjust menu position
task-3338419

X-original-commit: 37dfaf8fa19746e90974b21b3f9dfae1f2be2233
Part-of: odoo/odoo#124903
2023-06-21 00:13:49 +02:00
Maryam Kia 896a69cc30 [IMP] mail: disable escape on composer wizard
task #2793003
- rename Cancel to Discard on composer wizard
- disable escape on composer wizard to prevent closing the composer accidentally

closes odoo/odoo#120427

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-21 00:13:46 +02:00
Dossogne Bertrand d9b1b470b8 [IMP] hr_holidays: improve stress days display
Before this commit stress days were displayed as colored rectangles
on the calendar which made it ambiguous compared to leaves.
After this commit the stress day have the number colored and in bold
instead and the signification has been added to the legend on the side.
Moreover, clicking the event displays a popover giving a short
description of the stress day instead of opening a time off creation
modal.
This commit also adds `web/static/src/views/calendar/util.js` which
exports a method generating a datespan expression given two dates.

task-3226525

closes odoo/odoo#125749

X-original-commit: eb2b6068a998812890c8d37330c986fd3fc30d4f
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-06-20 20:32:48 +02:00
Michael (mcm) da85977e83 [FIX] web: fix domain selector double click
Before this commit, we needed to double click on "add a rule/group"
to execute the action if focused an input.
This commit fixes this issue, we can now click once to execute the
action of the buttons.

task id: 3346327

closes odoo/odoo#125756

X-original-commit: 0db23b5a7e29f8714a63375c5d86f5d1b2220bda
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-06-20 18:01:48 +02:00
Jorge Pinna Puissant 3b330abd15 [FIX] web: setting compile label correctly
- Open Settings;
- In the search write : __comp__.props

Before this commit, some settings are shown. This occurs because of un
error in the compiler, where we add to the search list, the path of the
label, and not the label itself.

closes odoo/odoo#125739

X-original-commit: 2a4dc724d0d791ea52dc73b79e582c726ece21da
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-06-20 15:58:40 +02:00
Mathieu Duckerts-Antoine 6adcd292b3 [FIX] web: search panel: fields should not be added in search bar
Let us consider the search arch

    <search>
        <field name="foo"/>
        <searchpanel>
            <field name="bar"/>
        </searchpanel>
    </search>

The two tags "field" are supposed to generate different objects:
 - the first one should generate an entry in the search bar autocompletion
 - the second one should generate a search panel section.

It turns out that the second field did also generate an entry in the
search bar. This is of course wrong. We fix that problem and add a test.

closes odoo/odoo#125724

X-original-commit: 7e62e3cf569e59a676a834198854f415fa0ae590
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-06-20 15:58:35 +02:00
tsm-odoo 90dd769e93 [IMP] im_livechat, *: add emoji menu to embed livechat
*: mail, web.

This PR adds the emoji menu to the embed livechat. When mounting
the livechat on the odoo frontend, the env is shared between the
livechat app and the main app. This is an issue regarding the
overlay service since the `OverlayContainer` is mounted in the
light DOM while we would expect the overlay styles to be dicted
by the shadow DOM.

In order to solve this issue, an `OverlayContainer` is added to the
shadow DOM and a mechanism to determine whether the overlay belongs
to the light/shadow DOM is introduced.

part of task-2742676

closes odoo/odoo#125713

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-20 15:58:29 +02:00
Mathieu Duckerts-Antoine 850d52d0ae [FIX] web: orm: protect webSearchRead
The values for the key "async" found in some services is used to declare
async methods that should be "protected". The hook "useService" makes sure
that no code used to process results of those protected methods is
executed by a destroyed component. The orm method "webSearchRead" was
not protected due to a "typo".

closes odoo/odoo#125688

X-original-commit: 2899888a2449b42b2c5d37846fc9411da6f7f9cc
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-06-20 09:11:04 +02:00
Mathieu Duckerts-Antoine fa0f687337 [FIX] web: orm: protect nameGet
The values for the key "async" found in some services is used to declare
async methods that should be "protected". The hook "useService" makes sure
that no code used to process results of those protected methods is
executed by a destroyed component. The orm method "nameGet" was
not protected due to a "typo".

closes odoo/odoo#125683

X-original-commit: c2b9f14fa9fbf67063b8885b698ea17a63d79454
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-06-20 00:24:06 +02:00
Mahdi Cheikh Rouhou (macr) 0a89e70e5b [FIX] web : translate all content in customer preview
When we go into customer preview of a quotation for example and change the language different than English (to fr_BE for example)
we see that some of the content isn't translated  and still displaying in english.

Steps to reproduce the error :
1-Install sales and website app
2-Create a quotation for a customer and just save it don't confirm it.
3-Go to customer preview
4-Change the language to fr_BE
5-Click on "signer & payer"
6-You can see that it still display 'Full Name' in english and also some other terms

The origin of the problem is that all the parts that were rendered via a t-call gets rendered in english.
I investigated the problem and it turns out that the language code for the _t is alwyas english(https://github.com/odoo/odoo/blob/06719a84c52c7a97487b7ee0bef3bbe166d5b502/addons/portal/static/src/js/portal_signature.js#L45)
The problem is that the user_context.lang is always undefined here (https://github.com/odoo/odoo/blob/06719a84c52c7a97487b7ee0bef3bbe166d5b502/addons/web/static/src/legacy/js/core/session.js#L201)
As a solution I copied the code from 15.0 which was working fine (https://github.com/odoo/odoo/blob/4fa2dbcaf777c23758519ab0feb9707a7592cd6b/addons/web/static/src/legacy/js/core/session.js#L199-L209).

opw-3192666
.

closes odoo/odoo#125638

X-original-commit: 441c94270a4935d2b0b67a9f8201fcba9d15d957
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2023-06-19 19:17:00 +02:00
Samuel Degueldre 34bdde7204 [IMP] web: add tests and comments for reactivity utils
The reactivity utils were initially an ad-hoc solution to some problems
that came up when using the reactivity in places that are not
components. As it turned out that these needs are actually quite common,
the utils that were originally duplicated in many modules were moved to
the core utils in web, but there were no tests for these utils, and the
Reactive class was not documented.

This commit adds some tests for the reactivity utils and a docstring
motivating the existence of the Reactive class.

closes odoo/odoo#125549

Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-06-19 16:40:01 +02:00
Kamlesh Pathekar 7319f29d83 [IMP] web: make ability to modify archive confirmation
In this commit, we have implemented a dedicated function that enables
the customization of details in the confirmation dialog for the archive action.

task-3277195

closes odoo/odoo#125533

Related: odoo/enterprise#39926
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-19 16:39:36 +02:00
Samuel Degueldre 81be42d8f9 [FIX] *: ensure tour tips are correctly translated
*: account, crm, crm_iap_mine, event, hr_expense, hr_holidays,
hr_recruitment, lunch, mail, mass_mailing, point_of_sale, project,
purchase, purchase_stock, sale, survey, web, website, website_blog,
website_event, website_forum, website_sale, website_slides,
test_main_flows

In odoo/odoo#111103 the tour system was rewritten. The previous tour
system used to depend on the `root.widget` js module, and this module
was an async module that indirectly depended on `session_bind` which
would load the translations, meaning that the js module definition code
of the tours would only run after the translations were loaded. This is
no longer the case with the new tour system, this means that the module
definition code is executed as soon as the dependencies of that module
are fulfilled, which is generally befoe the translations are loaded,
causing most tour tips to not be translated.

This commit adds a hacky workaround for this problem: it creates a new
module that has a default export which is a promise, and has a legacy
alias, this creates an async module that waits for the translations to
be loaded. This module is then imported for its side-effect in all
onboarding tours, causing them to be translated correctly once again.

This commit also needs to convert the steps key in the tours internal
registry to a getter. In previous versions, the steps were directly
added as is to the internal state of the tour service, but since
odoo/odoo#122834 the steps are now mapped, and without a getter, any
edits to the steps occurring after registration will not be taken into
account. This causes issues in some modules that change original
behaviour of other modules (eg accounting makes invoices into a menu in
the accounting app instead of a top-level app in the home menu) as they
need to edit the steps of existing tours to make them work.

In a separate PR, we will implement a more proper fix by changing the
API of the tour manager so that we no longer need this workaround.

closes odoo/odoo#125284

X-original-commit: d130699ba82dc9919c9116f4b64a5e461ebb6319
Related: odoo/enterprise#42655
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-06-19 13:35:28 +02:00
Jorge Pinna Puissant 00cedbad65 [REF] web: Settings, labels search
This commit, removes from the compiler all the code made to collect all
the labels of the setting for the search. Now, the labels are collected
at mounted time, by the setting itself.

This commit prepares and is part of the task that aim to refactor the
relational model and migrate it to owl.

part-of task-id 3179751

closes odoo/odoo#125332

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-06-19 11:58:41 +02:00
Tom De Caluwé b9d6163d68 [FIX] web: handle early option selections in autocomplete
The autocomplete component intercepts certain key presses allowing the end-user
to select an option from the autocomplete dropdown using either the enter or
tab keys. Before this commit those keypresses where only intercepted when the
autcomplete selection list was already completely loaded.

Consider now for example an x2many list where the lines can be selected using
the autocomplete component. To add a line to the list the end-user will usually
type part of the record name and then select it with tab or enter. Three things
can happen:

* The enter keypress is handled after the list of options is fully loaded
* The enter keypress is handled while waiting for the list of options to load
* The enter keypress is handled while still debouncing the input, no request
to load the options has been made so far

The last two cases commonly occur when inputting lines with a barcode scanner
for example. In this case the enter keypress is ignored by the autocomplete
component and is instead handled by the list renderer component. This generally
results in the list renderer trying to create a new line but failing because
of missing required fields in the previous line. This seems more or less
acceptable. However, if required fields are already filled out or not present
in the list view, a new line is created while the current one remains empty.

This behavior is clearly counterintuitive, as such, this commit proposes to
wait for handling tab and enter keypresses while debouncing the input or
loading the list of options.

opw-3235288

closes odoo/odoo#125464

X-original-commit: 7776e89e293045731e077801113d4ff40507b7c1
Signed-off-by: Tom De Caluwé (tdc) <tdc@odoo.com>
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-06-19 10:40:57 +02:00
luvi b5e52601bc [IMP] web: add currency_field option documentation in monetary field
This commit add the documentation for the currency_field in monetary
field.

closes odoo/odoo#118199

Related: odoo/enterprise#40597
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-06-19 10:40:38 +02:00
Bruno Boi debefffd26 [FIX] web: sync reposition for nested poppers
This commit will have nested components making use of
the usePosition hook to synchronize their repositioning.

**Before this commit**
Each component handles its own repositioning logic.
If it is mounted somehow inside another component using that
same logic, conflicts occur in some circumstances.

**After this commit**
It is now ensured that, in case of nested positioned components,
the whole chain of repositioning computations is called in the
proper order: from the parent to the children.

**Example**
- Before
  ![before]
- After
  ![after]

[before]: https://github.com/odoo/odoo/assets/1159815/3c9cfae7-db68-4707-a73c-ad7e2e71d4bf
[after]: https://github.com/odoo/odoo/assets/1159815/a21f56e0-d8e3-48c1-9509-8e6ee5040d4b

closes odoo/odoo#125531

X-original-commit: 9f947ba3fd3a00a0c80efc40186c36e0de78de16
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-06-19 09:30:58 +02:00
Maruan Aguerdouh (magm) 6e05d55b04 [FIX] web: proper display of pages headers for companies view form
Steps to reproduce:

1. Activate Dev mode
2. Settings > Technical > User Interface > Views
3. res.company.form
4. In the architecture add more pages
`<page name="test1" string="This is a test ABC DEF"/>
<page name="test2" string="This is a test ABC DEF"/>
<page name="test3" string="This is a test ABC DEF"/>
<page name="test4" string="This is a test ABC DEF"/>
<page name="test5" string="This is a test ABC DEF"/>
<page name="test6" string="This is a test ABC DEF"/>
<page name="test7" string="This is a test ABC DEF"/>` Save manually
5. Settings > Users & Companies > Companies
6. Open any company.

Issue:

Tabs go off the screen instead of moving down a row like in previous
versions.

Solution:

Adding the proper `overflow-x=auto` will handle the issue.

opw-3079492

closes odoo/odoo#125476

X-original-commit: 19c03accdb5754a6c223bce8ce2cc142e9b2be08
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-06-19 09:30:50 +02:00
Habib (ayh) da77c8fe45 [FIX] web: redirectWarningDialog does not markup noContentHelp HTML
The bank recon custom view relies on the noContentHelper. (When there are no records, a custom noContentHelper is  displayed including buttons to clear filters)

When the view is activated from a RedirectWarning, the action's help text is not marked up
therefore displaying raw html in the UI.

With this fix, the actions help key is marked up (very similar to the doActionButton)

To reproduce:
- On a DB with demo data
- Accounting -> Actions -> Lock Dates
- Set a lock date for all users (after the last unreconciled date, ensure there are no unposted moved before this date)
- You will be presented with a Redirect Warning Dialog
- Click Show Unreconiled Bank Statement Lines
- If there are lines, use the filter to search for "SomethingThatWontReturnRecords"
- You will see raw html

Task-3366470

closes odoo/odoo#125493

X-original-commit: 0086841addfc5b0e3293d205bdfe8dde67b32ce4
Related: odoo/enterprise#42740
Signed-off-by: Laurent Smet <las@odoo.com>
2023-06-17 00:10:49 +02:00
Brieuc-brd 3d44eb38d0 [FIX] web: binary_field: space between buttons
Prior to this commit, the buttons in `binary_field` didn't have space
between them.

This commit fixes this issue.

task-3334887
Part of task-3326263

closes odoo/odoo#125261

X-original-commit: 998f8cc8d096df9e2099df59bb35148f56c88533
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-06-16 23:01:12 +02:00
Hubert Van de Walle (huvw) 426d95eecd [FIX] web: remove duplicate month in arabic
Steps to reproduce
==================

- Switch to arabic
- Open a datepicker
- Select the month

The month are displayed twice in two different arabic namings.

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

There is an issue in the moment locale files since [0]. It has been made
apparent since [1].

Solution
========

Cherry pick a fix from the moment repo [2].

Revert the ar.js locale from before [0]

[0]: 11f3e7351a899848ec4df0107c3f6e2a627807ba
[1]: 6a1183f4c93ad068524a3242cd7b4e37f68fbf95
[2]: https://github.com/moment/moment/commit/251fba65cca5d5b2cf79f1f51a9d413c5e0cb161

opw-3349560

closes odoo/odoo#125381

X-original-commit: bfdf5baf4017058d7aff7c93fd504e684ed6783a
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-06-16 13:41:17 +02:00
Kamlesh Pathekar 3de84e9434 [IMP] project, web: modify calendar filter in project calendar view
In this commit, we renamed the calendar filter in task from
'Undefined' to 'Private' to be consistent with the terminology
used in the other views task.

task-3214107

closes odoo/odoo#115621

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-16 12:18:29 +02:00
Jorge Pinna Puissant e2d28e269d [REF] web: translation button always save
- Be sure to have two languages installed;
- Open a record with translations (product, for instance);
- Modify the field with translation, from "apple" to "peach";
- Open the translation.
- Modify the English term, from "peach" to "apricot";
- Save;

Before this commit, the field on the record still shows "peach", you
need to revert the changes to came back to "apricot" (the last modified
term). This occurs because the record is not yet saved, but the
translation is. This can create confusing behaviors.

Note also, that there is a different behavior when clicking on a
translation button between new record and existing records. The first
one will ask to save the record before doing the translation,
contrariwise, the last one will let you modify the translation without
saving.

In this commit, to avoid all confusion, and to be coherent between new
record and existing record, and to be also coherent with the always save
policy. We will save the record automatically before opening the
translation dialog.

part-of task-id 3179751

closes odoo/odoo#125149

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-06-16 07:54:48 +02:00
Jurgen (jugj) 62827e29f5 [IMP] web : Display the full text when hovering the search panel
Following an FP-Request, this PR aims to ease the life of the user
by indicating the full name of the elements that are truncated due
to their length as a tooltip.
task-3332648

closes odoo/odoo#125186

X-original-commit: 8512402d803e788347aa5f7012c4380c3dd34fae
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-06-15 19:59:05 +02:00
Pierre Rousseau 2fa42767c7 [IMP] web, point_of_sale: add reactive helpers
This commit adds a new module in web that contains a few helpers to
make it easier to use reactive in Odoo.

closes odoo/odoo#125136

Related: odoo/enterprise#42588
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-06-15 18:52:00 +02:00