Commit Graph
18201 Commits
Author SHA1 Message Date
Fabien Pinckaers 88f1b488c5 [IMP] web: reduce list icon's padding, to avoid label ellipsis
Example in SO: Quant... > Quantity, Unit P... -> Unit Price

closes odoo/odoo#146803

Signed-off-by: Fabien Pinckaers (fp) <fp@odoo.com>
2023-12-19 16:19:44 +00:00
Mahdi Cheikh Rouhou (macr) 13b338acd8 [FIX] web: solve datetime_picker with 12H format error
Isssue:
=======
When using a language with twelve-hour format (arabic) and open
datetime_picker it will raise an error.

Steps to reproduce the issue:
=============================
- Change lang to arabic
- Create a task in a project an try to modify the deadline

Origin of the issue:
====================
When we have `props.focusDateIndex != 0` and `props.range = False` we
will have only that index in the array `this.state.timeValues` ,
iterating over the array in `handle12HourSystem` function will result in
error because it starts iterating from index 0 which is undefined.

Solution:
========
Skip the undefined indexed;

opw-3629657

closes odoo/odoo#145424

Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2023-12-19 12:20:05 +00:00
Julien Carion (juca) 6e27c43c58 [FIX] web, project: avoid crash on file upload in portal
This commit fixes a crash that would happen on file upload in the project
sharing portal chatter. This crash was caused by the file size check in
the uploadFiles method of the FileInput component due to the fact that
the PortalFileInput calls this method once per file instead of once for
all files. The fix therefore ensures that the file size check will be
correctly applied in the case of a single file parameter instead of a
files array.

Steps to reproduce:
- Access the portal (with the /my route)
- Go to Projects
- Open the AGR - S00064 - Sales Order project
- Open any task in the kanban view
- Send an attachment in the chatter
- Before the fix, a traceback occurs on file upload

Crash introduced by https://github.com/odoo/odoo/pull/138203/commits/82b4395b2f12e1c86d2bd5c4acd47c321be071d8

opw-3628996

closes odoo/odoo#146214

X-original-commit: 8e2aef9ab607b06eb4667859204cfd7186b3f060
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-12-19 08:12:25 +00:00
Yannick Tivisse 533df43e67 [FIX] web: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Aaron Bohy 8f839e997c [FIX] web: allow to resize columns in grouped list views
Before this commit, columns in list views could be manually resized
only if there were records in the table. For the ungrouped case it
makes sense, as the table is empty anyway. However, for the grouped
case (either with empty groups, or with all groups being folded),
the list contains no records, but resizing could make sense as
there could be aggregate values displayed on group headers.

Technically speaking, there's no reason to restrict the resize
feature if the table is empty. Functionally wise, a user could get
confused if the feature is sometimes available, and sometimes not.
For that reason, this commit simply removes the isEmpty condition,
meaning that resizing columns is now always available, even if the
table is empty.

Task 3621490

closes odoo/odoo#146622

X-original-commit: 8fbdbb59eb3f37fad1fb75f4ff363f7fa17e6d27
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-12-18 14:34:25 +00:00
MerlinGuillaume 33a06f0e85 [FIX] web: open tooltip with mouse event on touch device
On device which are primarily recognized as "touch", when using a
mouse-like pointer, the tooltip can't be opened both on "touch" and on
"hover" (withe the mouse).

This commit fixes it by removing the escaping that prevented the mouse
events' listeners from being registered on touch-enabled devices.

Steps to reproduce:
1. Using Chrome, open the developer tools and click on "Toggle device
   toolbar"
2. Install Contacts
3. Go to Contacts and open the form view of any contact
4. Now click again on "Toggle device toolbar" to disable it but do not
   reload the page: touch device capabilities will be loaded but you
   will be able to use a mouse
5. Click on the question mark next to "Tax ID", nothing happens

opw-3493571

closes odoo/odoo#146621

X-original-commit: 5cbfa9751d6186ac6515a4341676706a807642ec
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-12-18 14:34:24 +00:00
Aaron Bohy 23611e65fa [FIX] web: correctly display domain in field tooltip (debug)
This commit fixes 3 issues with the domain in field tooltips, in
debug mode.

1) it only displayed the domain defined on the field in the model,
 not the domain set in attrs in the view, if any.

2) when the domain was the empty array, `domain: ` was displayed.

3) unset values should not appear in the tooltip (invisible,
 column_invisible, required, readonly).

opw 3455119

closes odoo/odoo#146563

X-original-commit: 8c4ff1fac9eb003c23770bf74f9d7ffe062f6ce7
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-12-18 09:31:44 +00:00
Odoo Translation Bot 304a6caa14 [I18N] Update translation terms from Transifex 2023-12-17 00:08:26 +01:00
FrancoisGe 857de1b61e [FIX] web: history back from home menu
Since PR odoo/odoo/pull/124068, the browser history back no longer works
correctly when navigating from the home menu to applications. It requires
two history backs instead of one.

Why:
Two pushStates are performed on the router, the first to add the menu_id
and the second to apply the action associated with the menu.
These two pushStates are not in the same setTimeout, which causes two
changes to the url. So two entries in the browser history .

Solution:
We perform the two pushStates in the same setTimeout. This causes
only one url modification and therefore one entry in the browser history.

How to reproduce:
- Go to the home menu
- Click on the app A
- Return to the home menu using the toggle menu
- Click on the app B
- Perform a history back
- The home menu is displayed
- Perform a history back

Before this commit:
    The home menu is still displayed

After this commit:
    The app A is displayed.

closes odoo/odoo#146143

Enterprise: odoo/enterprise/52683
X-original-commit: 8e3152fbfbb4a836ab9663d009fbcacbe3554ae8
Related: odoo/enterprise#52697
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-12-15 15:49:35 +00:00
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
Mattis Megevand (mmeg) ae9efe2a17 [FIX] web: match preview of invoice and its report
Steps to reproduce:
- Make an invoice and setup the layout of the document
- A preview will be displayed
- Make the invoice and download it

Issues:
The layout of the preview and the invoice doesn't match the updated layout from commit 3764914c86.

Solution:
Correct the view of the report templates.

opw-3584286

closes odoo/odoo#145815

X-original-commit: 778cc239010f3bb8618824fdaf06cb19922d6498
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-12-12 10:34:47 +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
Odoo Translation Bot 8ab45d4a85 [I18N] Update translation terms from Transifex 2023-12-10 00:12:46 +01: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
Odoo Translation Bot 2ac98dc2e5 [I18N] Update translation terms from Transifex 2023-12-03 00:18:54 +01: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