Commit Graph
15545 Commits
Author SHA1 Message Date
Romeo Fragomeli e95b3d1c47 [FIX] web: avoid search bar overflow
Overflowing search facets do not wrap making them disappear from view
when too long. This can happen when searching a single field for
multiple values (as they are bundled in the same facet).
The problem is fixed by allowing facets to wrap.

Steps to reproduce:
* Open a view with a search (kanban, list, ...)
* Add many, many long terms search for the same field
  => BUG the search overflow outside the search bar

opw-3581553

closes odoo/odoo#146133

X-original-commit: acd476a4ded3ca873e10dc4cc72668efdcb2c629
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-12-14 13:04:12 +00:00
Jorge Pinna Puissant 3e92da43e1 [FIX] web: clickall should not click on tablet mode views
Before this commit, clickall was clicking on an app that redirect to a
tablet mode view. The issue with this is that clickall don't know how to
exit the view, so it was stuck in the view.

This commit adds that view on the blacklist of clickall.

Also, this commit adds an error message when clickall is stuck in a view.

closes odoo/odoo#146216

X-original-commit: 8f365824c9dddacf1b3a40688a30c8498df3d5d4
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-12-14 08:00:58 +00:00
Aaron Bohy 64be692f7e [FIX] web: kanban: always open dialog if quick create fails
Before this commit, when the user tried to quick create a record in
a grouped kanban view (by clicking on the "+" icon of a column, for
instance), and then clicked on the "Edit" button of the quick
create, if the name_create rpc failed, the webclient switched to
the form view and an error was displayed.

The displayed error was about a destroyed component trying to do an
rpc, namely the kanban controller. This is because it does 2 things
when the name_create failed: it opened the form view in a dialog
and it also switched to the form view. The latter was unwanted:
in case of errors, we don't want to switch to the form view but
rather to quick create from a dialog.

The error was actually caused by a small mistake: we use the
record variable to determine if the quick create succeeded and if
we can switch to the quick created record. However, that same
variable was already set before, for another purpose.

OPW 3620671

closes odoo/odoo#146141

X-original-commit: 01bc79051b22f41eff20d860327ed0e41b572cd4
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-12-14 08:00:57 +00:00
Hubert Van De Walle 63a4481ad4 [FIX] web: reset expanded fields on import compatibility switch
Steps to reproduce
==================

- Go to users
- Open the export dialog
- Expand the Groups field
- Add the Groups > Groups/Access Controls field
- Check the import compatibility option
- Expand the Groups field again
=> `TypeError: this.knownFields[id] is undefined`

Solution
========

The expandedFields were not reset. We also need to update the t-key to
take the compatibility state into account.

opw-3378834

closes odoo/odoo#146116

X-original-commit: d2f52abb8ce1b7e5291e0de7d4ea7788f39115bd
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-12-13 15:53:00 +00:00
Julien Mougenot 803b4ac29a [FIX] web: do not apply same datetime picker value
Before this commit, the equality check performed by the datetime service
relied on a JSON-strigified version of the value on one end, and on an
array of ISO strings on the other end. This meant that the value was
never equal to itself and that the `onApply` callback would be called
even if the value remained unchanged.

This commit fixes that by ensuring that the compared values have the
same shape.

closes odoo/odoo#145929

Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-12-12 23:08:57 +00:00
Julien Mougenot f0924e0b6f [REF] web: add missing types for datetime hook & service
This commit adds missing type definitions for both the datetime picker
hook and service.

Part-of: odoo/odoo#145929
2023-12-12 23:08:57 +00:00
Abdelouahab (abla) 3947fb81fa [FIX] web: toggler button must remain visible
To reproduce
============
- go on any record with list view (for example a Quotation)
- Check many hidden fields in the list view to show them
- The dialogue box for checking and unchecking hidden fields moves
with the horizontal scrollbar, sometimes even going off screen.

Problem
=======
the position of the dropdown menu is computed using the position of the toggler
butoon, so if this button moves the menu moves with it

Solution
========
make the toggler button sticky so it's always visible and the dropdawn menu
will keep same position.

opw-3589726

closes odoo/odoo#145784

X-original-commit: 6fb2619866893b47c8cb947a40f3457625960a5c
Signed-off-by: Bastien Fafchamps (bafa) <bafa@odoo.com>
Signed-off-by: Abdelouahab Laaroussi (abla) <abla@odoo.com>
2023-12-12 14:05:03 +00:00
Bastien Fafchamps (bafa) d5986fb9d9 [FIX] web: Fix readonly modifier not working with clickable option on statusbar field
Before this commit:
The readonly readonly modifier of the statusbar field was not taken into
account when the "clickable" option was set.

After this commit:
Even if the "clickable" option is set to true, if a readonly modifier is
set, it will prevent (or not) changing the stage of a status bar.

closes odoo/odoo#145766

Opw: 3222998
X-original-commit: 9e1d01bc44e5e90ed2b809cfadbd05a5793b3c07
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Bastien Fafchamps (bafa) <bafa@odoo.com>
2023-12-11 18:30:45 +00:00
Samuel Degueldre 07fd47ab0b [IMP] web: update owl from 2.2.6 to 2.2.7
Release notes:
https://github.com/odoo/owl/releases

Commits:
- [IMP] types: correctly support Function type for props-validation
- [IMP] app: allow to instantiate templates lazily
- [FIX] compiler: compile named slot in t-component in named slot
- [IMP] devtools: update the devtools documentation
- [IMP] owl-vision: syntax scripts, single quotes attributes and slot props highlight and switch below command
- [IMP] doc: improve documentation of useExternalListener
- [FIX] devtools: remove highlights when out of devtools
- [IMP] devtools: highlight component on select
- [ADD] owl-vision: vscode extension initial commit

closes odoo/odoo#145460

Forward-port-of: odoo/odoo#145342
Forward-port-of: odoo/odoo#145236
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-12-11 17:21:12 +00:00
Yosua Nicolaus 201371954d [IMP] web: string domain function handler
When getting a domain from activeFields in Owl, sometimes the value
passed is not a list or function.

When the field mentioned have a `check_company=True` in the
initialization, the domain passed will be in a form of string instead of
a list.

This commit aims to publicize the domain handler in Field so that it can
be used anywhere by calling the function, as getting field's domain is
getting increasingly common

Task-id: 3549961
Part-of: odoo/odoo#145355
2023-12-11 17:21:10 +00:00
Serge Bayet (seba) c2ad20fc93 [FIX] web: support color functional CSS notation
This commit enables support for functional color notation in CSS
(https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/color).

This new feature accommodates various color spaces utilized within the
'color()' CSS function, seamlessly converting them into an RGBA format
that is comprehensible to the right panel.

Steps to reproduce:
- Enter edit mode
- Add a snippet with a column
- Click on the column
- Set border-width to 5px, enter
=> A gray border appears but the option colorpicker shows no color

Since [this commit] the border has as default opacity of 15%. But now
the custom color in the colorpicker is correctly set.

[this commit]: https://github.com/odoo/odoo/commit/fad514ebdc25b9de03fd387a0c07dbbc274c364e

task-3536051

closes odoo/odoo#137698

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-12-11 17:21:05 +00:00
Julien Banken 591a73939a [FIX] web: add check to not scroll calendar view if component is destroyed
In the `onMounted` hook of the calendar renderer, the given callback
function will schedule a new function call using `setTimeout` with a
delay of 0 if some conditions are satisfied. The scheduled function will
then trigger a scroll in the calendar view to display a precise timeslot.

If the component is destroyed before the scheduled function is executed,
the scheduled function may trigger an error as the root element of the
calendar will be removed from the DOM when the component is destroyed.

This commit will fix that issue by checking that the root element of the
calendar exists before calling the `scrollToTime` function.

Steps to reproduce the error:
1. Open Knowledge
2. Open the template gallery
3. Select the template "Sprint Calendar"
4. Quickly apply the template

=> If you have the right timing: a traceback will be displayed indicating
that the function `scrollToTime` is not defined on `null`.

TO BE: No traceback should be displayed when applying the template.

task-3627780

closes odoo/odoo#145292

Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-12-11 08:29:18 +00:00
FrancoisGe 5fb51a7825 [FIX] web: don't save readonly field in unknownCommand
Before this commit, during an onchange, when we received an update command
for an x2many referring to an unknown record on the front end (does not
have a Datapoint Record) during the save, we sent all the contents of
these commands without removing the readonly fields.

In this commit, we're going to filter all the readonly fields according
to the backend (fields). We're not taking modifiers into account because
the command refers to an unknown record, so we don't have the data to
evaluate modifiers correctly.

How to reproduce:
- Go to a form view with an x2many field
- Edit a field that causes an onchange
- The onchange command returns an "update" command for an x2many record
  which is not on the actual page (unknown record) with a value which is readonly
  according to the backend
- Click on the Save button

Before this commit:
  The "update" command doesn't contain the readonly field

After this commit:
   The "update" command contains the readonly field

Task ID: 3607260

closes odoo/odoo#145556

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-12-08 17:19:12 +00:00
Sébastien Theys 48d73a1ead [FIX] web: improve perf of matchDomain
`operators` object only contains 3 specific strings as key, and most
domain items are arrays. Checking the type of the item to avoid a costly
and failing `in` check, as well as using direct key access, allows
gaining a lot of time.

The method going from 60ms to 6ms when running the test
"Load 100 recipients at once" on my machine, and the specific line tends
to 0ms.

Part-of: odoo/odoo#145442
2023-12-08 15:57:52 +00:00
Ruben Gomes (rugo) 292dfc20ba [REF] web: nested_sortable_tests
Exports the sortableDrag function, so it can be used in other modules (like account_reports for example).

closes odoo/odoo#145027

Related: odoo/enterprise#50283
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
2023-12-08 15:57:46 +00:00
Prakash Prajapati 37e1e18284 [IMP] web, project, (_todo): add hide_label options in the state_selection in all view
If someone wants to show the label of the state_selection field then
it can be shown

like-
 <field name="xxx" widget="state_selection" options="{'hide_label': False}"/>

task-3475416

closes odoo/odoo#136901

Related: odoo/enterprise#48060
Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
2023-12-08 15:57:43 +00:00
Adrien Dieudonné 96ad7f806f [FIX] web: wkhtmltopdf overlapping table lines
Before this commit we had an issue when a product's description took
more than one page. In this case, the following `<tr>` was overlapping.

By removing this line we remove an old fix that seems not working
anymore... It looks like it was needed when a customer wanted to repeat
the table header on each page. This use case is supported by Odoo as
we suggest it as a customization in the code, see here:
"<!-- In case we want to repeat the header, remove "display: table-row-group" -->"
This feature is still working without this fix except when a line
overflows onto another page but the removed fix doesn't help anyway...

There is another line that refers to this fix for accounting reports
but we prefer to keep this commit minimal and clean it in master.

Note that this bug is also present in 15 but as this issue is quite old
and tricky we prefer to not fix it this until we have other complains.
Feel free to backport this commit if needed.

Steps to reproduce:
- Go to Sales
- Create a new quotation
- Add a product with a very long description that takes at least a whole page.
- Add anoter product.
- Print it as a .pdf.
=> Product descriptions overlaps on page 3.

opw-3411031

closes odoo/odoo#145458

X-original-commit: a809e63eae5224696965781e9ab7e2e195555292
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-12-08 14:30:13 +00:00
abd-msyukyu-odoo 6772252c99 [FIX] web, web_hierarchy: ensure proper scroll speed/behavior
In [1], an automatic scroll feature was introduced in order to always scroll to
the bottom of the hierarchy view after each patch.

The `isAnchor` option is removed, because in `Knowledge` it has the side effect
of completely scrolling the article down to the last card of the Hierarchy
view, hiding the rest of the view. Also, that option was not useful in the
standard configuration since there is only one scrollable parent.

Another issue is that the `scroll-behavior: smooth` css property also affects
the scroll speed of the `draggable_hook_builder`, which means that drag scroll
speed is extremely slow and does not follow the speed computed in that file.
This style is therefore removed, and `scrollTo` is refactored:
  - Make use of the native `Element.scrollTo` method, which has a `behavior:
    "smooth"` option.
  - Move and rename methods to compute the closest scrollable from the
    `draggable_hook_builder.js` to `scrolling.js`.
    - They check if a scrollable has a client[Dimension] greater than 0 for
      eligibility.
    - They check the proper `overflow-[axis]` from the computed style (`auto`
      and `scroll` are eligible).
    - A test of `scroller_service_tests` was updated because even if an element
      has `max-height: 0`, its children still can have a height and make their
      scrollable ancestor have a `scrollHeight` greater than its own height.
  - If the `scrollable` option is given to the function and the provided
    element is not actually scrollable, compute a `scrollable` ancestor instead
    of doing nothing.
    - This is more flexible in a situation where a supposedly "scrollable" is
      computed with a selector and ends up not "scrollable" in some custom
      configuration (i.e. embedded view in Knowledge).

The `scrollable` option is removed, since `scrollTo` is already able to compute
the correct closest scrollable element, no need to hardcode a selector for that.

Finally, the draggable speed and threshold for the Hierarchy view are set to
the same values as a Kanban view for user experience consistency.

[1]: https://github.com/odoo/odoo/commit/3489a0d28fdbaf607d18b00d144bb00bae2727c3

task-3562116

Part-of: odoo/odoo#143941
2023-12-07 15:53:07 +00:00
abd-msyukyu-odoo fbac26be7c [FIX] web: get next config for model loaded with values
In `web_hierarchy`, the model is always loaded with values.
However, when a record (component) props are updated, its resId can change (i.e.
if the ordering in the hierarchy view changes), therefore not only the `root` of
the model should be updated with the provided values, but the config should be
reevaluated as well since some record (datapoint) getters use it.

task-3562116

Part-of: odoo/odoo#143941
2023-12-07 15:53:07 +00:00
mano-odoo 998e40cf07 [FIX] web, project: list renderer alignment top
Prior to this commit some td in the list renderer were vertically align
on the middle while other are aligned on top. This comes from commit[1]

This commit removes the vertical-align: middle to rely on the inherited
alignment from the `<td>` which is inherited until the `<table>` el
which set the alignment on `top`.

To visually center the icons previously centered by vertical-align,
a new variable: `$o-line-size` is created.

This variable accounts for the total size of a line which is the font
size multiplied by the line height.

In our case this ensure that the icons line height in the list view is
the same as the <td> that are containing text.

[1]: odoo/odoo@53f6053997

task-3557566

closes odoo/odoo#145290

X-original-commit: cce036d03ccd7c12f34ed930b8964e26464732ba
Related: odoo/enterprise#52275
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-12-07 10:07:59 +00:00
Julien (jula) ad702c20b1 [FIX] base: call dedicated method for regenerating assets bundles
__Current behavior before commit:__
The logic to regenerate assets bundles is located in the frontend (i.e.
the JS is making the calls to retrieve and unlink them) which is not
very clean.

Furthermore, when doing so, the old assets might still be included on
cached views that called them with `t-call-assets`.

Therefore, regenerating assets bundles can break the CSS or the JS as
long as the view cache is not cleared.

__Description of the fix:__
A new backend method is implemented for regenerating asset bundles.
This provides a dedicated and maintainable approach. Additionally, the
cache is explicitly cleared during the regeneration process.

__Example of steps to reproduce the issue on runbot:__
1. Check `Disable cache` in chrome dev tools.
1. Little bug icon > Regenerate Assets Bundles

closes odoo/odoo#145279

X-original-commit: b8e1f9f880e4723ddbe595043d22b565ad735832
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Signed-off-by: Julien Launois (jula) <jula@odoo.com>
2023-12-07 10:07:58 +00:00
AH-Yussef 7d58fe2c16 [FIX] web: align progress bar to end of table cell
Steps to reproduce:
- intall Employee app
- install HR Gamification module (not an app)
- Go to Employees app
- Go to Configuration > Challenges > Challenges
- Create a new challenge with goals and participants
- Go to Configuration > Challenges > Goals History
- Open up a group
- The word "Completeness" and the progress bar is not aligned correctly, the bar is supposed to be directly underneath the label.

Investigation
- The styling of the progress bar inside table cells https://github.com/odoo/odoo/blob/1f12670a8061a4eb3fd57abca238d8daf7ef574d/addons/web/static/src/views/fields/progress_bar/progress_bar_field.scss#L27-L32 was missing to align the progress bar to the end of the containing flex box

opw-3599052

closes odoo/odoo#145190

X-original-commit: 9a02e535882bf6844fffdb7c6a71053645e3af68
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Ali Hassan Youssef (alhy) <alhy@odoo.com>
2023-12-06 14:07:57 +00:00
Elisabeth Dickinson 8e1906724c [FIX] web: quick fix to remove ButtonBox overflow on mobile and tablet
Because the number of buttons in the `ButtonBox` isn't dependent on 
the size of each button, sometimes the bar overflows on smaller screens. 

This should probably be redone to calculate the size of each button 
depending on its contents (which can be translatable).
In the meantime, this fixes the overflow issue.

task-3573807

closes odoo/odoo#141163

Related: odoo/enterprise#50256
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-12-06 14:07:49 +00:00
Elisabeth Dickinson a01a6822dd [FIX] web: fix oe_stat_button dropdown width and button alignment
In the stat buttons' dropdown under "More", if the text is too long
a horizontal scroll appears.

Fixed by removing the fixed `width` and the `w-100` class on the
dropdown box.

Because of `height: 100%` which is needed for the button to be aligned
with the other buttons, the contents of the dropdown button are not
centered.

Fixed with a `d-flex` and `align-items-center`.

task-3573807

Part-of: odoo/odoo#141163
2023-12-06 14:07:49 +00:00
Jorge Pinna Puissant 5940233032 [FIX] web: remove nondeterministic error when waiting for RPC
Before this commit, to be sure to wait for all the RPC are finished
before continue, the clickbot, patched the ORM class and saved in a
waiting list the model and method called, and removed when finished.

The issue with this, is that when calling an ORM with a protected RPC
service (as is the case for the RequestBatcherORM), if the caller
component is destroyed before the return of the RPC, as the RPC service
is protected it will return an always pending promise, and the RPC will
never be removed from the waiting list and the clickbot will wait
indefinitely.

Now, we use the RPC event directly, so even if the component is
destroyed, we know that the RPC was finished, and is removed from the
waiting list.

Note that, this commit doesn't have a test, making a test for this case
is quite difficult, and some of the causes of the issue will be removed
in future versions.

closes odoo/odoo#145081

X-original-commit: c444255004d37f5153de24d938a4b7bc4497e858
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-12-06 09:53:22 +00:00
Saiyed Irmi 18fbdea689 [IMP] web: fix alignment of progress-bar
Steps:
 - Open Appraisals
 - Go to Skills
 - Add new skill
 - Progress-bar was left-aligned in both rtl and ltr mode

 Issue:
 - progress-bar should always aligned to the right (it should be to
  the left only in rtl mode) in list view.In rtl mode, white space coming
  before progress-bar.Progress-bar with different percentage values
  was not aligned.

 Cause:
 - the progress bar alignment was inconsistent, especially when dealing
   with RTL languages.

 Fix:
 - By justifying the content of progress-bar to flex-end and of rtl mode to
  flex-start  Applying min-width to progress-bar value.
 Task: 3525850

closes odoo/odoo#145094

X-original-commit: 52a90d638b79f313c6803b09e54b721eeee2e2fa
Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
Signed-off-by: Prakash Prajapati (ppr) <ppr@odoo.com>
2023-12-06 08:20:12 +00:00
Abdelouahab (abla) 11a81bf88b [FIX] web: check children instead of childNodes
To reproduce
============
on time Off -> allocations, open a record and try to open studio
-> Owl Traceback

Problem
=======
the ButtonBox is not well compiled, we check if it has children
using `!el.childNodes.length`, but this property returns the total
number of child nodes, including text nodes ...
So counting text nodes, we proceed to create ButtonBox node and fill it
with children `for (const child of el.children)`, but the property `el.children`
doesn't take into account text nodes, which leads to return `''` then a null object

Solution
========
as we loop on `el.children` the check must be done using the same property.

opw-3603952

closes odoo/odoo#145080

X-original-commit: e9e8626c7dabd2d0ba51390279e5adb1eb3aef6f
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-12-06 06:58:52 +00:00
Sébastien Theys 4d00cedaca [FIX] mail: fix race condition in "make voice message in chat"
runbot-46626

closes odoo/odoo#144901

Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-12-05 21:15:22 +00:00
Arthur Detroux (ard) 88b0af6fcb [FIX] web, web_editor: fix drag and drop in firefox
When dragging a snippet inside an iframe, after the snippet has been
dropped, all events are still being captured by the iframe.
This leads to option previews not being displayed and the user having
to click outside the iframe to be able to interact with the options.

This seems to be a bug in Firefox related to how it handles
pointerevents. This does not happen when the events are "mousedown" and
"mouseup" instead of "pointerdown" and "pointerup".
So this commit checks if we're on firefox desktop and if its the case,
uses mousedown and mouseup.

Steps to reproduce:
- On Firefox, go to the Website App and drop a banner snippet
- Click on one of the images in the snippet
- Drag the image
- Hover over the options
=> The options are not previewed

task-3607685

closes odoo/odoo#143343

Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-12-05 19:53:25 +00:00
Chrysanthe (chgo) de0c841f2a [FIX] web: allow CP navigation to fill container
This commit allows the navigation inside the Control Panel to fill all
the container height.

Prior to this commit, the navigation arrows inside the control panel
were not taking the whole height of the container, which would cause a
weird visual render where everything would have exactly the same height
except these elements.

To fix the issue, we adapt some of the flex properties used in the
layout, ensuring everything is well aligned.

task-3580216

closes odoo/odoo#140670

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-12-05 19:53:18 +00:00
Maruan Aguerdouh (magm) ad0783edf1 [FIX] web: word-break support for list view in safari
Steps to reproduce:

- Open Sales App
- Go to any quotation
- Go to the products lines and change the name of the product to be long
- Save the product and go back to the quotation
- Now click on Other information, and then click again in Order Lines.

Note this only happens in Safari, the behavior for other browsers like
Chrome or Firefox is correct. The problem is that word-break property it
seems to not be supported properly by safari. In this case we can use
the word-wrap property instead, with the same value break-word.

opw-3513128

closes odoo/odoo#144893

X-original-commit: 6a72984a0461b60c3f1863c4be28d780bec847c7
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Maruan Aguerdouh Mohtar (magm) <magm@odoo.com>
2023-12-05 10:54:57 +00:00
Jorge Pinna Puissant c7b07f4ec5 [FIX] web: avoid closing dropdown outside the active element
When a dropdown open a dialog and on the dialog there is a new dropdown,
before this commit, when clicking on the second dropdown, the first one
will close.

This is an issue with closing the first dropdown, is if the dialog is
opened using useOwnedDialogs, the dialog will also close.

Also, if the dialog is open to throw a "find more" of a x2many field,
even if the dialog is not close, as the dropdown will close, the
original field will also be destroyed and it will raise an error.

Now, we avoid closing dropdown's, when opening new dropdowns that there
are not on the same active element.

opw-3464528

closes odoo/odoo#144238

X-original-commit: 6fec387d258dfd945dbbd48a9aab91ce6113ccaa
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-12-04 15:10:30 +00:00
Mathieu Duckerts-Antoine 167999c350 [FIX] web: pivot: no duplicates in read_group groupby
Since https://github.com/odoo/odoo/pull/103510, the read_group parameter "groupby" can no longer contain
implicit duplicates. For example groupby=['date', 'date:month] doesn't work
anymore. Here we remove all duplicates from groupby before making a read_group.

closes odoo/odoo#143792

Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2023-12-04 15:10:29 +00:00
Romeo Fragomeli e39efcaa52 [FIX] mail: dark mode: text attachment readability
There is a specific rule that set the `o_AttachmentViewer_view`
background color to a static white color (i.e. `#FFFFFF`).
Then in dark mode, while the font color for the attachement "view"
is set to white due to the `color-scheme` meta, the background
keeps its white color, which makes the content unreadable. In this
commit we use instead the `$white` variable, which is properly
adapted in "dark mode", for the background color.

Steps to reproduce:
* Open Odoo
* Set Odoo in Dark mode using the dropdown menu of the user
* Open the Note app
* Make a note or open one
* Upload a JSON attachment in the chatter
* Open the preview of the attachment
  => BUG text in white and background color in white => text not visible

closes odoo/odoo#144763

X-original-commit: 2af9edb3ca45db0a36552ca751136b7b0c7b6a18
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2023-12-04 13:23:46 +00:00
mano-odoo bb24a4cf65 [FIX] web: fix day selection arrow & responsiveness
In commit[1] the class `order-3` is applied on the ViewScaleSelector 
component but it breaks the view in timesheet. This commit creates a 
props to contextually use this class on the component.

[1]: f9222c4976 

task-3580643

closes odoo/odoo#140750

Related: odoo/enterprise#50055
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-12-04 13:23:31 +00:00
Elisabeth Dickinson 28b0168463 [IMP] web: truncate date in list view
When the width of the column is too small to fit the date, the date was
cut by the following column instead of having its content
truncated. This could be seen on the "Creation date" in the list view of
Sales Quotations.

task-3463329
part of task-3326263

closes odoo/odoo#144039

X-original-commit: b9675c38b49d99e00e401dbdb90445354aab43c3
Related: odoo/enterprise#51684
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-12-04 11:58:16 +00:00
Hugo Carlier (Huca) f3d565738f [FIX] web: take arrow size into account when displaying popup
Currently, the arrow of a popup is not taken into account when computing
its position resulting in an overlap with its parent element in some
cases. This commit fixes this situation.

Steps
=====
- Install module project_enterprise
- Create a project with a milestone set at the end of the current month
- Assign this milestone to a task with planned dates set
- Open the Gantt view of the project
- Hover the milestone diamond

Issue
=====
- The popup displaying the milestone name is partually overlapping the
diamond resulting in a flicker when the mouse is positioned on the left
of the diamond.

Cause
=====
Margin-bottom and margin-right are used in the style of popover. This
has no effect on the positioning of the popover that relies on left/top properties.

Fix
===
Those are replaced by negative top/left margins

task-3457106

closes odoo/odoo#144546

X-original-commit: d10d38c8ff67b0912055d9cfd680d606b24aebc0
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-12-01 18:14:24 +00:00
dhba 3f3a654952 [FIX] web: traceback in emoji picker
Before this commit:

- Attempting to press the Enter key in the emoji picker when the search result
  was empty would lead to a traceback error.

After this commit:

- Now, Pressing Enter key in the emoji picker with an empty search result no
  longer triggers a traceback error.

task-3576930

closes odoo/odoo#144434

X-original-commit: d9ea54fe8b3cf73da0e32155f2f08803ffe7440a
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
2023-12-01 18:14:18 +00:00
Samuel Degueldre c191a08f03 [FIX] web, web_tour: fix auto-start, tour priority and tour resetting
Previously, if a tour was added to the registry after the tour service
started, it would not be registered and could not be started. A previous
PR ( odoo/odoo#125055 ) fixed this behaviour, but did not auto-start the
corresponding tour if needed. This commit fixes that.

It also runs "auto" tours in exclusive mode, ie only one tour at a time,
to prevent the check delay from being impacted by other tours which can
lead to unwanted behaviour, especially with bootstrap modals, which are
not immediately closable as soon as they start displaying, and can cause
some test tours to fail.

Tours that auto-start no longer reset to the first step when refreshing
the page, and when multiple tours are running in parallel and can show
their pointer on the same screen, the tour with the highest
priority/lowest sequence is now the one to show their pointer, instead
of it being the one that was started first.

task-3377185

closes odoo/odoo#143598

X-original-commit: 4bba22763436645e94b484fc1cca3752effa9a25
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-12-01 18:14:11 +00:00
Dhrumil Shah b4a269d695 [FIX] web: fix alignment issue for feature names
Issue:
- Before this commit when we see helpdesk team form view some of the features
   names are not aligned with checkbox

Cause:
- Issue was caused because of the icon size is large and so it features names
   were not aligned

FIX:
- we have removed the font size of the icon so that text get aligned with the checkbox

task-3463622

closes odoo/odoo#144184

X-original-commit: 9b52a265056d9ee1e82537d1e8bd93b00911d127
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-11-30 18:37:55 +00:00
Romain Derie 88a4146f7a [FIX] web: prevent browser print to be limited to what's above the fold
Commit [1] moved page scrollbar to #wrapwrap, which introduced some
issues. This was needed to not have a double scrollbar when the builder
edition panel was moved from left to right.
One of the issue if that the browser print was not working anymore.

A workaround has been found with this commit to make it work again. It
is just reverting the mentioned commit when inside the browser print
preview, which can be achieved through css directly.

Note that in the future, this PR [2] should revert the fact that the
scrollable element is the #wrapwrap.

Also note that while this fix allow printing pages again, there is still
the same behavior as in Odoo 13 and before (where you can print pages
too): the printing preview will not be in desktop size but display the
pages as on tablet size.

[1]: https://github.com/odoo/odoo/commit/4e7be69825163c0a0ff41c882a196fc7f3158fb3
[2]: https://github.com/odoo/odoo/pull/98429

opw-3557672

closes odoo/odoo#144107

X-original-commit: eb0a05319789ebc3732ef623a3811b5bc8b43daf
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-11-30 11:44:59 +00:00
Aaron Bohy 39874b0e9c [FIX] web: tests: make mock fetch almost sync (micro-tick)
Before this commit, a studio qunit test ("edit/delete menus")
sometimes failed on runbot, because it tried to click on a button
in a modal footer, but it found 3 of them, because another dialog
which was expected to be closed at that moment, was still opened.

There was no guarantee for the dialog to be closed because of the
way browser.fetch was mocked. The fetching part was ok, but the
function returned a Response object, whose `json` method is async
(setTimeout-like async, i.e. "real" ticks).

This commit mocks some functions of the returned Response instance
to ensure that, by calling nextTick after a click or whatever, the
fetch operation has been done, the body has been decoded, potential
renderings are finished and the DOM has been patched.

Runbot error 23054

closes odoo/odoo#143980

X-original-commit: 66ef3ae730a233dc510425e0a5baca2973de493e
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-30 10:13:23 +00:00
Chrysanthe (chgo) 5ba7e9e16c [FIX] web: fix bolder label in properties field
This commit fixes a visual issue with a label of the properties modal
that has a bolder font-weight than the other.

This issue comes from the fact we recently changed the behavior of our
`bold` and `bolder` variants.

To avoid this issue, we simply remove the label to render the text
directly inside the `label`.

task-3580556

closes odoo/odoo#143794

X-original-commit: 467fb0cb5318594a3b7222640645ad0d15d03c42
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
Signed-off-by: Chrysanthe Gomrée (chgo) <chgo@odoo.com>
2023-11-30 04:12:46 +00:00
Julien Carion (juca) 05eea6dfc1 [FIX] web: kanban: missing quickcreate button in empty kanban
This commit fixes an issue where the quickcreate button was missing from
the kanban view when it was grouped by a non many2one field and contained
no record yet (so that no column is shown yet).

Steps to reproduce:

-Go to a kanban view on a model with no record
-Group by as scalar value (eg: Description)
->The "New" button disappears

OPW-3459808

closes odoo/odoo#143793

X-original-commit: 112ba1cb64b5170fdefd267de8e765f87b444b56
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Julien Carion (juca) <juca@odoo.com>
2023-11-30 03:03:58 +00:00
Aaron Bohy 0dfada3f3f [FIX] web: avoid translation not ready error in errors
Before this commit, error message like "Uncaught Promise" were
translated. However, it may happen that the error is created (and
thrown) before the translation service is ready, i.e. before the
translations are loaded. Indeed, the error service is started first
and starts listening on errors that might be raised. If a module
throws an error (e.g. rejects a promise) before the localization
service is started, the error service being already set up, it
catches it and instantiates the appropriate Error. Doing so, a
"translation error" is thrown as translations aren't ready yet.

Translating those messages makes little sense anyway, as they
target developpers and they can't be found in the code if they
are translated. This commit thus stop translating them.

Issue found while investigating on opw 3602193

closes odoo/odoo#143551

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-29 16:30:19 +00:00
Michael (mcm) 036c72e5ec [FIX] web: disable browser autocomplete
Before this commit, browsers added suggestions when focusing fields.
This commit removes these suggestions.

Warning: there are two kind of autocompletion. One which suggests data
you already entered and completes only the current field if chosen.
The other is auto-fill which suggests your personal info like
email, address, ...
Only the first kind is fixed here, the second cannot be removed at the
moment.

task id: 3114291

closes odoo/odoo#143854

X-original-commit: 201cc48b50b374ea9445f0d148c4e0faeb825327
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-11-29 14:49:49 +00:00
Tom De Caluwé 48634a2adf [FIX] web: avoid week number calculation errors
When opening the calendar view in, for example, the timesheets app, the first
day of the week used for the number calculation is provided by the localization
service, which in turn requests it from the database. Because the first day of
the week is stored as a number between 1 and 7 in the res.lang model and a
value between 0 and 6 is expected by the DateEnv, offset errors can occur.

The error is fixed in various components (for example, the CalendarDatePicker
and CalendarCommonRenderer) but not in others (CalendarYearRenderer). Instead
of patching each component separately, a better solution is to require the
CalendarModel to expose a 0 to 6 firstDayOfWeek value as part of its public
interface.

opw-3389617

closes odoo/odoo#142056

X-original-commit: aea22a46515304df41dfaf427f5955824fe342f5
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-11-28 21:20:48 +00:00
Pierre Rousseau 0828bd1239 [FIX] board: do not give form view to children views
Before this commit, the form view of the board action is given to the
children views. This can lead to some issues, for exemple in the
following case:

- Add a pivot view to a board
- Click on a cell to open the list view
- Click on a record of the list view to open the form view

=> The form view used is the one of board, which lead to an empty view.

opw-3598945

closes odoo/odoo#143756

X-original-commit: f65efabb938bf5643754c426ad3db813d9eff581
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-11-27 11:20:10 +00:00
Mathieu Duckerts-Antoine 2b80c8e647 [FIX] web: pivot: clear sortedKeys when pruning
Due a typo, sortedKeys were not always cleared when pruning the
new trees after an update. Consequently the method _getTableRows could be
called on a inexisting sub tree. Here we simply fix the typo and a test.

opw-3584675

closes odoo/odoo#143714

X-original-commit: 3fa2d6e418daa2b1fa0df3c8d1ca643fac4cbaa2
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-11-27 09:51:11 +00:00
Samuel Degueldre eb1d96e011 [FIX] web: correctly display module errors in the qunit suite
Since the module loader rewrite, it now reports errors directly in the
DOM. The error alert also has the class "modal" so that in case a tour
comes accross a page with module loading errors, it will only look for
elements inside it and fail. But in the QUnit test suite, modals are
invisible by default, causing the page to be blank in those cases.

This commit adds a css rule to make sure that this error alert is shown,
and updates the code that was previously used to report these errors in
the qunit suite to instead simply check for errors reported by the
module loader.

closes odoo/odoo#143589

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-25 05:41:45 +00:00