Commit Graph
15524 Commits
Author SHA1 Message Date
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
Samuel Degueldre 5385b65384 [FIX] web: correctly use readonly value in datetime field
Previously, the datetime field read the value for readonly directly in
the attrs when extracting its props when available. This resulted in 2
separate bugs:
- in debug mode, props validation of the datetime picker would fail, as
it expects to receive a boolean for the `range` prop.  This was caused
by the fact that required was the raw attribute (a string) instead of
the boolean and ended up being propagated to the `range` prop
- outside of debug mode, the value for required did not cause a crash
but any value for required that was not empty would be interpreted as
truthy, causing the field to always be display itself as though it is
required. In non-range mode, this is invisible, but in range mode, it
would always show the second datetime input and the arrow between the
beginning and end date, even with required being 0/False, or a python
expression that may evaluate to false

This commit fixes that by instead reading the value for required from
the dynamic infos provided to `extractProps`, which will always be a
boolean and contain the value of the evaluated expression when
appropriate.

closes odoo/odoo#143509

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-24 23:57:36 +00:00
Mathieu Duckerts-Antoine 71ee2c0995 [FIX] web: expression editor: between operator
We make the expression editor support the between operator.

closes odoo/odoo#142483

Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-11-23 17:50:40 +00:00
Mathieu Duckerts-Antoine 40e0b4e324 [IMP] web: expression editor: model field selector
The component ExpressionEditorFieldSelector used by the expression editor
to allow the selection of a field has several drawbacks:
- the fields are not alphabetically ordered
- there is no possibility to (fuzzy search) a field
- the field types are not indicated in debug mode.
- the style is different from the classical style to be found in the
  domain selector.

Here we make the expression editor use a version of the ModelFieldSelector
component where the debug input is not shown. Indeed, this would require
some validation of the input value in order to prevent complex path like
user_id.company_id that are forbidden in studio for instance. Anyway,
there is not real need for such an input since it is easy to find/select
a simple path with the fuzzy search.

Task ID: 3599699

Part-of: odoo/odoo#142483
2023-11-23 17:50:40 +00:00
Julien Carion (juca) 019e11bb93 [FIX] web: m2o: always display 'No records' if no result found
This commit fixes an issue where if one sets no_create_edit and
no_quick_create to true on a m2o while no_create is unset, no dropdown
is shown to tell the user that no record was found. Since the quick create
and create and edit options are disabled by default when create is false,
we no longer need it in the condition and can only rely on quick create
and create and edit.

task-3599696

closes odoo/odoo#143202

X-original-commit: 9da78c1b2bdd85f06e8682b99c8c481e91546ec7
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-11-23 01:20:11 +00:00
mano-odoo d62662effc [FIX] web: model_field_selector header and contrast
In commit b47be9f254b2f7327ea3e0e92c6b1b97bff016d0 we changed the
background of the popover selector making the title unreadable in
white mode.

This commit applies the text-dark color to make sure the title is
readable. It also removes the primary background on hover behind the
btns to use a color change instead. We will later on improve this
component with the btn-link + contextual class to manage the hover
effect in another task.

When a field is selected the active class is added on the parent <li>
rather than the <button>. This commit applies it on the button to
display an active state on the selected element.

task-3577065

closes odoo/odoo#143164

X-original-commit: 3d664d6e7daedecc5e995636bfe055c9ba800bb2
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-11-22 16:04:06 +00:00
Aaron Bohy c9e3866b5f [FIX] web: fix SelectCreateDialog test failing randomly
Before this commit, the modified test sometimes failed on runbot
because it couldn't click on "Create and edit..." in the many2one
dropdown. Here's what happened:
 1) call editInput to write something in the many2one input
 2) call selectDropdownItem to select "Create and edit..."
This was done without mocking setTimeout.

The problem is that editInput triggers the opening of the dropdown,
but as setTimeout wasn't mocked, that opening was delayed. Then,
selectDropdownItem first clicked on the input to open the dropdown,
and then clicked on the requested item. It might happen that the
click on the input actually closed the dropdown instead of opening
it, if it had been already opened via editInput. In that case, the
test failed because it couldn't click later on on "Create and edit".

This commit also improves the test utils to better log what really
happens: in this case, the dropdown isn't open at all, so we
detect that specific issue and log it with a proper message (which
is different than "the dropdown is open, but I can find the item
you're looking found).

Runbot issue 28207

closes odoo/odoo#143044

X-original-commit: 220d4325866330235ceccd61b8d1d00d8c919ba8
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-22 07:43:10 +00:00
FrancoisGe d0b7736fa5 [FIX] web: fix profiling to show stats again
Since the refactoring to owl, the stats in the left zone were not shown
anymore and the hover was missing.

This was because the method that fixes the xpath to match line by line
the qweb, was done on a getter and not on the data itself.

Now we replace in the prop value, from this way, in every place we use
the getter, we have fixed the data with the xpath.

/t/div -> /t[1]/div[1]

closes odoo/odoo#142912

X-original-commit: 2124057052255d86591b9f3345bf7e62fcd8d3b3
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-11-21 23:24:03 +00:00
Aaron Bohy 5bd6dcd944 [FIX] web: tests: fix SwitchCompanyMenu tests failing randomly
Before this commit, some tests of the SwitchCompanyMenu sometimes
failed:
   - "companies can be logged in even if some toggled within delay"
   - "can toggle multiple companies at once"

They failed because the debounce delay between the first click to
toggle a company and the moment the company service is notified to
actually select the companies was sometimes too short for the 2 or
3 clicks on the menu to toggle companies to occur, as those clicks
are separated by nextTick(), i.e. a mix of calls to setTimeout and
requestAnimationFrame.

In tests, we patch the debounce delay to 0 by default, and before
this commit we set a delay of 50 in the two faulty tests. This
commit fixes the issue by keeping the real delay in those tests (1s),
as they aim at testing the fact that the user has the time to do
multiple clicks before committing the company changes and reloading.

Fixes runbot error 29962

closes odoo/odoo#142904

X-original-commit: 2ec65691ac11cb4216d873dcab77a84e2c35ba17
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-21 23:24:00 +00:00
Aaron Bohy 7cea6c5980 [FIX] web: fix form test failing randomly
The test 'buttons with attr "special" in dialog close the dialog'
sometimes fail on runbot because it can't click on 'Create and edit...'
inside the many2one dropdown. Before this commit, the test edited
the many2one as follows:
 1) edit input to write a new value (with editInput)
 2) click on the input to open the dropdown
 3) click on 'Create and edit...' in the input

But calling editInput opens the dropdown (even though the opening
is a bit debounced, which is why it only failed sometimes). So it
might happens, in rare cases, that the dropdown is already opened
when we click in the input (step 2), which closes it and makes
step 3 fail.

This commit changes the test to do something similar as what we do
in many2one_tests.js: we patch setTimeout to execute the callback
directly, and thus remove the opening delay. We call editInput
which triggers the opening of the dropdown, and we click inside
the dropdown.

Runbot issue 24739

closes odoo/odoo#142863

X-original-commit: 4a011149cba968585d5e74ee4f4fff7212c729e3
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-21 22:00:10 +00:00
FrancoisGe a24aa74602 [FIX] web: m2o field use the right context
When we save a many2one in a dialog opened by the external button, we
trigger a "read" of the "display_name" to update it if the changes made
in the dialog have had an impact on it.
Before this commit, the context used for this "read" was completely wrong,
it was an unevaluated string. This commit will therefore allow you to use
the evaluated context.

closes odoo/odoo#142862

X-original-commit: 7e9c8d41f5d035a00117198539ddebdbd8b4aa7c
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-11-21 22:00:09 +00:00
FrancoisGe d71d52d16b [FIX] web: popover clickAway don't preventDefault by default
Since commit 3d218e1, clicking outside
a popover closes the popover and performs a preventDefault on the event.
As a consequence, changes made in the property definition popover are no
longer applied when the popover is closed by clicking outside.

Problem:
The preventDefault has the consequence of cancelling the input change
event allowing the change to be applied to the property definition when
the popover is closed.

Solution:
Remove the preventDefault by default and only use it in the case of the
calendar view, which is the only use case that wants to prevent the click
event so as not to open a record creation dialog (see commit 3d218e1).

How to reproduce the PropertyField bug:
- Go to a form view with a properties field
- Click on the edit property button
- A popover opens so that you can edit the field definition
- Type a few characters in the label input
- Click outside the popover

Before this commit:
    The value inserted in the popover is ignored

After this commit:
    The value inserted in the popover is applied to the property.

It is not possible to write a test reproducing this native browser behaviour.

closes odoo/odoo#142842

Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-11-21 22:00:07 +00:00
clesgow 7157ded5d1 [FIX] web: allow clicking on button column cells
Steps to reproduce:
- Purchase -> Open any RFQ/PO.
- Click on the cell containing the "forecast" button, without clicking
on the button itself.

Following 28f2622, it will generate a traceback when clicking on a cell
list from a button column.
Since button columns don't have a `name`, no `record.fields` will match
and throw a traceback, as we try to access `type` from nothing.

closes odoo/odoo#142597

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-21 20:06:46 +00:00
Samuel Degueldre 86635b5cc6 [IMP] web: extract owl app creation logic into helper
Currently mounting an owl application using the Odoo web framework takes
a good bit of boilerplate. This is both annoying but also creates the
opportunity to misconfigure created applications. This commit exctracts
the application creation logic to a helper function which will make it
much easier to create Owl applications correctly.

task-3580007

closes odoo/odoo#142498

Related: odoo/documentation#6493
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-21 20:06:45 +00:00
Bastien PIERRE 4c3fde5412 [FIX] web: min width for many2many_tags
Before this commit, the width of the cells for many2many_tags was often
too small, so the tags were truncated. (e.g.: the tax_id column on the
sale order lines on the form view of the sale order)

After this commit, the column has a min-width of 150px

closes odoo/odoo#141415

Task-id: 3581756
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-21 20:06:37 +00:00
Janvi Lakhore 07aa750194 [FIX] web: fix save button issue
Steps:
- Open Field Service
- Go to gantt view
- Create new task
- Leave the title and customer field empty
- Save the form dialog

Issue:
- The customer required notification show in the gantt view instead of form view
dialog.

Cause:
- When we save the form 'saveRecord' method triggered and this doesn't return
 anything.

Fix:
- Add the return statement in 'saveRecord' method.

task-3502839

closes odoo/odoo#142698

X-original-commit: e7d999429dcf91501b0803d32639a181277cb5f0
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-11-21 07:56:11 +00:00
Xavier Luyckx (xlu) 5a62dbfc73 [FIX] web: adapt dropdown-item checkmark position
Prior to this commit, the positioning of the checkmark in the project
task state dropdown was slightly off, not optimally aligned.

This commit solves this alignment.

task-3575446

closes odoo/odoo#142725

X-original-commit: 539f156d480473cfd8bf31ed10aea427248fa3fc
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-11-20 15:51:32 +00:00
Adrien Dieudonné 6eea43a706 [REV] web: blockui when executing a target=self act_url action
Follow-up of https://github.com/odoo/odoo/pull/134277

This reverts commit 91b80fbb5c as it adds some unwanted visual
effect. In other words, the "block UI" is never unblocked when some
actions are triggered. this is specific to the mobile app when the
URL is outside of the webview scope ("/web" or "/pos"). Even if
the target is self, the mobile app forces a new tab because opening
something else that the backend in the webview could disturb users.

Steps to reproduce:
- Open "Field Service"
- Choose a task and start it
- Stop it and confirm time spent
- Sign report
=> A new tab is openened in the mobile app and the block UI is
never unblock in the app.

To fix this, we simply decided to avoid to use the block UI for
act_url actions. this is consistent with what we did previously:
See https://github.com/odoo/odoo/commit/ebe64aafacec8eaa69a5a1781fc159ff77bc884a
We will only use `BlockUI` when really necessary and not by default.

Note that this commit will also remove the block UI when you do
some operations on apps like installing it. For now, we consider
that is OK. This means that the user will be able to continue his
work during installation. Also note that if the user navigates to
another application during the process, the page will not be refreshed
at the end. He will have to do it himself by pressing "F5" to be able
to see the app in the home menu.
In the future, the idea should be to better notify the user at the end
of this king of background operations but we will see...

closes odoo/odoo#142656

Signed-off-by: Romain Estievenart (res) <res@odoo.com>
2023-11-20 12:41:39 +00:00
FrancoisGe daab70796f [FIX] web: image/sign field doesn't correctly update its unique
Before this commit, if the value of an image/sign field is modified by an
onchange and the record is saved manually, the old image is displayed.

Why:
ImageField's rawCacheKey, which is used to know if the image has been updated,
is not updated. So we will reuse the old image.

Solution:
rawCacheKey becomes a getter that always returns the current value of __last_updated.

How to reproduce:
- Go to a form view with a char field and an image field
- Edit the char field
- An onchange is performed and modifies the value of the image field
- The new image is displayed
- Click on the save button

Before this commit:
    The old image is displayed

After this commit:
    The new image is displayed

closes odoo/odoo#142471

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-11-20 11:13:26 +00:00
Lucas Perais 0bc8d169f5 [FIX] web: popover validation target props
Using the OdooEditor, the following use case arises often:
- create an Element with document.createElement.
- append that node into the DOM tree of an iframe.
- spawn a popover with that node as target.

The spec (https://developer.mozilla.org/en-US/docs/Web/API/Document/importNode) considers this a malpractice:
`Before they can be inserted into the current document, nodes from external documents should either be:
cloned using document.importNode(); or
adopted using document.adoptNode().

Note: Although Firefox doesn't currently enforce this rule, we encourage you to follow this rule for improved future compatibility.`

Before this commit, in debug mode, there was a crash because the class of the new Element
did not match the class of the element's ownerDocument defaultView.

After this commit, we keep the check that says that the target should be an instance of
the iframe's document's Element class, but we fallback onto the main Window Element class as well.

closes odoo/odoo#142464

X-original-commit: 0cdd8cf9354e494c3e56d9eefe81c3fb6a59ac09
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-11-20 11:13:25 +00:00
Saiyed Irmi addfbb5a39 [FIX] web: button assign appear on mouse hover in Activity View
Steps:
 - Open Projects
 - Go to Tasks
 - Open Activity view
 - There is a button to assign a new user

 Issue:
 - The button to assign a new user should only be visible on hover

 Cause:
 - There was no css class added for button in activity record.

 Fix:
 - By making button visibility hidden by default and should be visible only on
   hover.

closes odoo/odoo#142381

Task: 3522113
X-original-commit: d60519ae4cb3c9c7d83e8143c3015c28b2a929ad
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-11-20 11:13:24 +00:00
Morgane (morm) 01ad9b9213 [IMP] web: kanban header priority star alignment
Prior to this commit, the alignment of the `priority` field star inside
the header of the `kanban card` was not perfect.
Adding `margin: auto` fixes this issue.

task-3586924

closes odoo/odoo#141506

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-11-20 11:13:15 +00:00