Commit Graph
13696 Commits
Author SHA1 Message Date
FrancoisGe e4862f26f4 [FIX] web: reload record when you click on attach_document
The goal of this commit is to restore the behaviour of the legacy
attach_document widget.

How to reproduce :
- clicking on the attach_document button and selecting a file

In legacy:
We have a full reload of the view (Render and reload the record).

Before this commit:
Render the view without reloading the record.

After this commit:
We reload the model which causes a rendering of the view and a reload of
the record.

Why do we have to reload the record ?
If the action linked to the attach_document button modifies the record,
we want this modification to be applied in the view and not only on the
server side. To do this, we need to reload the record data to ensure
that all the changes are displayed in the view.

closes odoo/odoo#103891

X-original-commit: 82d4f0cd2f0265393cf66cd7be1a0a714584400c
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Signed-off-by: Georis François (fge) <fge@odoo.com>
2022-10-24 14:12:26 +02:00
William Henrotin 1ed423a181 [FIX] web: make pdf viewer expands on notebook
Similar to the html field widget, this commit add the display: block
class to the pdf viewer widget in order to make it use the whole area of
a notebook zone:

Task: 2991906
X-original-commit: a1407975c2fafedef5f5eb7d4597cfcd88117e49
Part-of: odoo/odoo#103872
2022-10-24 09:16:55 +02:00
FrancoisGe 0055542952 [FIX] web: edit a required field in a list view in multi_edit
Before this commit, in a list view in multi_edit mode and editable="0",
it was possible to edit a required field with an invalid value.

Why:
In the PR 101924, we decided to no longer pass readonly/required of fields
in non-editable views (if no editable="1").

Solution:
To know if a view is editable, you should not only look if it is
editable="1" but also if it is multi_edit="1".
So we want to pass the readonly/required fields if the view is
editable="1" or multi_edit="1".

How to reproduce:
- Go to a multi_edit="1" and editable="0" list view with at least one
  required field on the server side
- Select the checkbox of the record you want to edit
- Edit that field with an invalid value (e.g. clearing a text field)
- Click outside the line being edited

Before this commit:
The record is saved with the invalid value

After this commit:
An alert dialog is displayed to warn us that the value is invalid.
The record returns to readonly mode with the old value.

closes odoo/odoo#103790

Related: odoo/enterprise#33066
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-10-23 12:30:03 +02:00
FrancoisGe c998fdd77b [FIX] base: consider multi_edit="1" views editable
Since odoo/odoo#95729

nodes with a `groups=` are completely removed from the views when
the user is not part of the group, instead of being made invisible.

In that PR, views have been adapted to add back fields, with invisible="1",
when they were required, for instance when they were used in a domain
of another field which was still there despite the user is not part
of the given group.

As `tree` views having `multi_edit="1"` where not considered
as editable views, the domain of fields in these views were not
validated:
- https://github.com/odoo/odoo/blob/1fb8fa16ab7dc298d54f089d7163fb556dbc5fcc/odoo/addons/base/models/ir_ui_view.py#L1460
- https://github.com/odoo/odoo/blob/1fb8fa16ab7dc298d54f089d7163fb556dbc5fcc/odoo/addons/base/models/ir_ui_view.py#L1321-L1322

while they are well required for the web client,
in `multi_edit="1"` this is possible to edit relational/many2one field,
and therefore it will do `name_search` calls using the domain of the
field, and therefore the fields used in these domains must always
be present in the views. Without it, a crash in the web client occurs
when attempting to edit the relational/many2one field.

This revision targets to consider the `multi_edit="1"` tree views
as editable, to make the field domains validated as they should be.

Hence, views are adapted to add back fields with `invisible="1"`
when they are required in domains of other fields.

Part-of: odoo/odoo#103790
2022-10-23 12:30:03 +02:00
Bruno Boi c964462774 [IMP] web: update owl from 2.0.0-beta-22 to 2.0.1
Release notes: https://github.com/odoo/owl/releases/tag/v2.0.1

- fix: runtime: correctly throw an error for duplicate object keys
- fix: parser: give t-set-slot="default" priority over the content
- fix: blockdom: correctly reorder children in heterogeneous t-foreach
- fix: portal: correctly move portal content when target is after it
- fix: blockdom: fix event_catcher traceback when a parent component has an empty child

closes odoo/odoo#103847

X-original-commit: be996cf423ce09be4e4661c0b42a97d92a4dcdb4
Related: odoo/enterprise#33097
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2022-10-21 23:13:48 +02:00
Hubert Van de Walle (huvw) 7b948a731f [FIX] web: discard rejected reloadProms in magicReload
Steps to reproduce:

  - Go to a list view with multiple items
  - Click on an item
  - Delete it
  - Go back in history twice (Using the browser navigation) to return to the list view
  -> We can't click on another record

opw-2854113

closes odoo/odoo#103808

X-original-commit: 92c90823139b413c8289d1c323ad694fc8220a61
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-21 17:17:19 +02:00
Sergey Shebanin 0c0656eadd [FIX] web: statusbar field on mobile doesn't show current value
closes odoo/odoo#103715

X-original-commit: a045d4555f3546bf9b0327b24f5c6f3fecf247f1
Signed-off-by: Luca Vitali <luvi@odoo.com>
2022-10-21 10:11:14 +02:00
Loan (lse) a03f5cd631 [FIX] web: improve error message when missing the format type of field
To reproduce:
1. Create a (incorrect) view manually. For example, inherit from
`res.config.settings.view.form` and do add the following view architecture:
```xml
<data>
  <xpath expr="//div[hasclass('settings')]" position="inside">
    <field name="field-dont-exist" widget="upgrade_boolean"/>
  </xpath>
</data>
```
( In practice, Odoo will refuse to let us save the view if it is incorrect
(we can bypass that by pushing directly in the database for testing) )

-> When trying to open the settings app, you will have a cryptic JS error:
`TypeError: field_utils.format[(formatType || this.formatType)] is not a function`
The goal of this PR is to improve the error to ease its correction.

Note: This issue can happen in practice after an upgrade or a failed
uninstallation of a module.

OPW-2952309

closes odoo/odoo#103686

X-original-commit: 73dccc3e51472f76cf5cf32a4fbd48d0b58b5c36
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-21 08:23:54 +02:00
Bruno Boi d54bff857a [FIX] web,calendar: calendar and popovers design
Fix the hatching and striking effects for events
by moving some scss rules to the right place:
- o_event_hatched
- o_event_striked

Various fixes for the calendar popovers to display properly, such as:
- year scale popovers
  - proper popover body padding and font-size
  - style that depends on attendee status
- other scales popovers
  - inverse the condition when the popover footer must shrink

closes odoo/odoo#103661

X-original-commit: 917d8e4123517c73d8bd6a4bd83becf1b0ee1090
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2022-10-20 17:17:09 +02:00
Bruno Boi c9bec348db [REM] web: calendar unused design classes
This commit removes some style that is dead code, related to classes:
- o_cw_custom_hover
- o_cw_nobg
- o_calendar_hatched
- o_calendar_hatched_*
- o_calendar_striked
- o_calendar_striked_*

X-original-commit: 4a19e031ae70a44369970147dd1735da66a9ea64
Part-of: odoo/odoo#103661
2022-10-20 17:17:09 +02:00
Aaron Bohy b7dfc7f71c [FIX] web: SearchPanel: fix race condition with sections
This commit fixes a race condition spotted by the click all test,
in the Lunch application. To reproduce, go to Lunch > Configuration
> Products, in the list view, toggle filter "Archived" s.t. there's
no record matching the domain (and nothing displayed in the search
panel anymore), then switch to kanban view, and remove the filter.
On a multi-build, this scenario fails ~4 times out of 10.

The issue occurs because a re-rendering of the search panel is
triggered by its parent (because of the filter change), but the
search panel didn't compute its active sections yet (this is done
when the "update" event is triggered on the search model). The
exact situation is hard to reproduce, but if there are non empty
sections in the model, and the active sections haven't been computed
yet in the search panel, it crashes. For instance, it happens all
the time by delaying the promise returned by "_fetchSections".

This commit doesn't introduce a qunit test because we didn't manage
to reproduce the exact same situation in a test. This makes the
Lunch click all test pass all the time though.

closes odoo/odoo#103638

X-original-commit: b84df7e08b4d413de2e8a0b1df6cb8d6ad4b08cf
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-20 14:14:56 +02:00
Aaron Bohy 3f12de691b [FIX] web: ConfirmationDialog: do not call confirm twice
Before this commit, multi clicking quickly on the "Ok" or "Cancel"
buttons of a ConfirmationDialog would call the confirm/cancel
callbacks multiple times. For instance, in "Mass mailing", create
a new mailing and click "Send". In the confirm dialog, clicking
quickly multiple times on "Ok" would call the "Send" button action
multiple times.

This commit also ensures that we wait for the promise of the
confirm callback before closing the dialog. This highlighted an
issue in the ORMBatcher, as we didn't reject the promise when
the batched rpc failed. As a consequence, the confirmation dialog
never closed itself. This has been spotted by an existing test.

Fixing #74647 (from 16.0 to master)

closes odoo/odoo#103572

X-original-commit: 95f8266a5b84f5faa59a713019ab713392b3ef78
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-20 10:19:58 +02:00
FrancoisGe 70a80d4cd1 [FIX] web: click on wrong options in autocomplete
The purpose of this commit is to fix an indeterminate error in
the test_03_sale_quote_tour.

Error: UncaughtTypeError: Cannot read properties of undefined (reading
'unselectable')

Why:
In the autocomplete component, it is possible to replace the sources
without it being rerender. It is therefore possible to click on a option
that no longer exists in the component's internal state, which causes
the crash.

Solution:
We wait that all the sources are loaded before replacing them.

closes odoo/odoo#103497

X-original-commit: f25df0be75082caf9e8ed62c581a13fe82a27546
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Georis François (fge) <fge@odoo.com>
2022-10-20 10:19:47 +02:00
Mathieu Duckerts-Antoine 6aac153473 [FIX] web: py.js: offset in to_utc
Take a (py.extras) datetime representing the moment "2022-10-17 00:00:00"
in the timezone of Brussels. Trying to get the related utc moment through
to_utc gives wrongly "2022-10-16 23:00:00". This happens because the
months are not numbered in the same way in Date or datetime, so that in
October for example, the offset applied was that of November which is
-60 instead of -120 (summer/winter change). We fix that problem.

closes odoo/odoo#103579

X-original-commit: ee1a8d26f241f2f7bea6880afcc946119b0e6bd8
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-10-19 20:47:54 +02:00
Mathieu Duckerts-Antoine e0b852bc6e [FIX] web: core: offset in to_utc
Take a PyDateTime representing the moment "2022-10-17 00:00:00" in
the timezone of Brussels. Trying to get the related utc moment through
to_utc gives wrongly "2022-10-16 23:00:00". This happens because the
months are not numbered in the same way in Date or PyDateTime, so that
in October for example, the offset applied was that of November which is
-60 instead of -120 (summer/winter change). We fix that problem.

closes odoo/odoo#103561

X-original-commit: a11e1fb5f702400fe51938362fe3f24570977ba9
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-10-19 18:06:59 +02:00
Joseph CaburnayandBruno Boi 390955b751 [FIX] web: fix traceback when shift-tab on list field
**Before**

A traceback is raised when pressing shift-tab on the first column of
the first row in a focused list field as shown in the vid:
https://youtu.be/g97ZTp1QdBE

**After**

shift-tab on the first column of first row will now unselect the list field
and immediately focuses on the previous field.

**Additional change**

We now allow skipping focus on the dropdown toggler by introducing new
props.

closes odoo/odoo#103485

X-original-commit: 9ba9977e42d201035b5299bc13ba03211cddbc1f
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
2022-10-19 12:10:41 +02:00
Mathieu Duckerts-Antoine 8c2ec7b4de [REF] web: remove PieChart
Now that the module web_dashboard has been removed https://github.com/odoo/enterprise/pull/31641,
the component PieChart is unused. We remove it.

closes odoo/odoo#102761

X-original-commit: 3e92c60034cedcd999572bb7e93c8b05ca07be70
Related: odoo/enterprise#32573
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-10-19 11:11:53 +02:00
Mathieu Duckerts-Antoine dcb0498ab8 [REF] web: remove unused props in reporting views
Now that the module web_dashboard has been removed https://github.com/odoo/enterprise/pull/31641,
some props of the reporting views graph and pivot have become unused.
We remove the code related to those props.

X-original-commit: 7d231d1d37707dab4b0ecdd4e2e7cc4535ba6196
Part-of: odoo/odoo#102761
2022-10-19 11:11:53 +02:00
Mathieu Duckerts-Antoine 9f4130bd57 [FIX] web: kanban, list: no search model in env
When a x2many record is opened in a X2ManyFieldDialog, it can happen
that the form renderer displayed in the dialog also contains a x2many
that use a kanban or list renderer. In those cases, the View component
is not used. Consequently, the WithSearch component responsible for
making available a search model in the env is not used either so that
a crash occurs at the setup of the kanban renderer (and sometimes later
on for the list renderer). We fix that problem.

closes odoo/odoo#103349

X-original-commit: 2c284317b6dc3c0f0b4e9e376dcee755d81222da
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-10-19 10:14:55 +02:00
Thomas Lefebvre (thle) b4f9086bff [FIX] web: correctly append attribute expressions
Steps to reproduce:
    - install "Peru - Accounting" module (l10n_pe module);
	- try to open a contact form.

Issue:
    An error message appears with an impossibility of access to the form.

Cause:
    The function that concatenates the different attributes should not take into account the "{{ ... }}" tags already put in before.

    Example:
    When appending `scope && scope.className || ""` to `{{props.record.isInEdition ? 'o_form_editable' : 'o_form_readonly'}} d-block {{ props.record.isDirty ? 'o_form_dirty' : !props.record.isVirtual ? 'o_form_saved' : '' }}`;
    This is generated:
    `{{{{props.record.isInEdition ? 'o_form_editable' : 'o_form_readonly'}} d-block {{ props.record.isDirty ? 'o_form_dirty' : !props.record.isVirtual ? 'o_form_saved' : '' }} scope && scope.className || "" }}`
    instead of:
    `{{props.record.isInEdition ? 'o_form_editable' : 'o_form_readonly'}} d-block {{ props.record.isDirty ? 'o_form_dirty' : !props.record.isVirtual ? 'o_form_saved' : '' }} {{scope && scope.className || "" }}`

opw-3018917

closes odoo/odoo#103460

X-original-commit: 846d3b3c67e8ef46ecb29c5d72d895b2b852fc10
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2022-10-19 07:21:55 +02:00
Joseph Caburnay fd8633e345 [FIX] web: properly resequence newly created kanban column
**Issue:** https://watch.screencastify.com/v/5ewbfVCuC0cAyVil9hqW

**Solution:**

We always reorder all the records when one of the records don't have
`sequence` (handleField) information.

closes odoo/odoo#103459

X-original-commit: 2dededb2cea3b9f60a7bd27c282ec7b5db9456a0
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2022-10-18 23:08:59 +02:00
Aaron Bohy 5da13e1d5a [REF] web: remove legacy fields/widgets compatibility layer
This commit removes the code that wrapped legacy fields and widgets
(coming from the legacy registries) into owl components and added
them to the wowl registries. This temporary compatibility layer,
which was incomplete and only allowed us to merge the new views
without converting all fields/widgets in once without breaking
everything, is no longer necessary as we now have converted all of
them into owl components.

X-original-commit: 555959c87e25faa71396f61479e8bb41b66ac164
Part-of: odoo/odoo#102606
2022-10-18 18:05:01 +02:00
Aaron Bohy 651ddf69f1 [REF] web: FormViewDialog: no longer support legacy js_class
Now that all views are converted to owl, that compatibility layer
is not needed anymore.

X-original-commit: 736572b5ae7692e0fe4b61f3331317ff1be16e8f
Part-of: odoo/odoo#102606
2022-10-18 18:05:01 +02:00
fdardenne 5ba91f1d69 [FIX] web: checkbox: deactivate onChange when disabled
Before, even if the checkbox is deactivated, clicking on it
cause an `onChange`.
This caused unexpected behavior, the form view changed to a dirty
mode even if the checkbox was in read-only mode and nothing
was modified.

Now, the checkbox does not call `onChange` when deactivated.

closes odoo/odoo#103429

X-original-commit: 4802c2528cfa23c5981fa30fa69cfa23f28faf05
Signed-off-by: Luca Vitali <luvi@odoo.com>
2022-10-18 17:12:04 +02:00
Romeo Fragomeli 0e12bcb3da [FIX] web: typo in MEDIAS_BREAKPOINTS
In commit, odoo/odoo@3c10fcadee
a typo was introduced in the `minWidth` (`769` instead of `768`).
This typo was resulting in a strange behaviour in the webclient when the
width of the viewport was `768px`.

Step to reproduce:
* Open Odoo
* Go to a form view (e.g. Sales -> Select a record)
* Set the size of the viewport to 767
* Set the size of the viewport to 768 => BUG nothing happens
* Set the size of the viewport to 769 => BUG redraw but to late, CSS
  already change due to its media break point rules when it was at 768.

Ref:
https://getbootstrap.com/docs/5.1/layout/breakpoints/

closes odoo/odoo#103397

X-original-commit: 82d8348d3d5a05e065a07af1924de579cbec3a35
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2022-10-18 14:15:13 +02:00
Lucas Perais 152be24c17 [FIX] web: RelationalModel: pass view's context down to evalContext
Have some keys in the context passed to a view.
Have a many2x field in that view that uses those keys in its domain
with some flavor of:

```xml
<tree>
    <field name="many2one" domain="[['someField', '=', context.get('some_key')]]" />
</tree>
```

Before this commit, the global context was not added to the evalContext used to evaluate the domain.

After this commit, it is.

closes odoo/odoo#103370

X-original-commit: 93c5e6cbc06bdb6ab2cfc959b68be8088837e1de
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-10-18 13:17:25 +02:00
Lucas Perais 2a3bd05bac [FIX] web: form settings: keep scroll position per module app
Have more than one Odoo module installed. Go to the Settings.
Scroll the first page.
Change the app in the sidebar.

Before this commit, the scroll position was the same for all modules (or apps, same thing).
It is not wrong per se, but when changing app, there is no reason that the scroll position of the former
is somehow correct business-wise.

After this commit, the scroll position is stored and restored on a per-app basis.

closes odoo/odoo#103369

X-original-commit: 01b16c392b888ceaccc8b0c95da142dbb90517ef
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-10-18 13:17:22 +02:00
Lucas Perais 9390319b79 [FIX] web: settings form view should not autofocus its field
Have a simple char field somewhere in res.config.settings.

Before this commit, when arriving on the settings form view, the settings page
was scrolled. This was because the standard FromRenderer has and used its autofocus feature,
thus focusing the first text field present in the view.
After that, the Settings form view gave the focus back to its search view input.

After this commit, the FormRenderer's autofocus feature is deactivated.

X-original-commit: 2c67b1dbe15d2cb77ee0b50514a4b9d41a006114
Part-of: odoo/odoo#103369
2022-10-18 13:17:22 +02:00
Lucas Perais 62526a3546 [FIX] web: discarding an existing record in form view action target new.
Do an action in target new that will spawn a record in its form view.
The typical example is "Edit View: XXX" in the debug systray.

On the dialog, click on "Discard".

Before this commit, that button did not close the dialog.

After this commit, that "Discard" button closes the dialog.

closes odoo/odoo#103275

X-original-commit: 08751e0eef0cefe74e626ffa8ba26a5e8f18113f
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-10-18 13:17:06 +02:00
Lucas Perais 4c224159b9 [FIX] web: basicRelationalModel trigger_up reload
Before this commit, the basicRelationalModel could not handle the legacy
event "reload" trigger by the basicModel., resulting in crashes.

In particular, when the method "action_archived", via the method `record.archive()` returns an action
(in target new usually) to confirm or ask the user for some additional information, closing that modal
will trigger a model reload via the event.

After this commit, this whole flow is tested and works correctly.

closes odoo/odoo#102826

X-original-commit: 0abb90fb2aa7857990b5f5dae95e9e891125b5fa
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-10-18 13:17:00 +02:00
Alexis Lacroix 7a23c27e85 [IMP] base: add banner_route to graph view attributes
odoo task id 2985113

closes odoo/odoo#102397

Related: odoo/enterprise#32382
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2022-10-18 13:16:39 +02:00
Bruno Boi e0139fc677 [FIX] web: calendar filter without main color attr
# Before
A calendar arch without a main color attr that has
some dynamic filters would crash.

# After
No traceback occurs, the default color is used.

closes odoo/odoo#103350

X-original-commit: 54e690b9c789ea862ce3039dd6040e210fa80b39
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2022-10-18 12:19:37 +02:00
Mathieu Duckerts-Antoine 9a640383c9 [FIX] web: relational model: many2one update with no label
Before this commit, click on the "Search More" option in a list many2one
and then selecting an option in the opened dialog would lead to a crash.
This used to happen because the record is updated with a value of the
form [integer, undefined] (that is with no defined label) and nothing was
done in the list model to fetch that label, making impossible to render
the many2one after the update.
Here we make sure that a label is available after the update.

closes odoo/odoo#103271

X-original-commit: 81abccf729ef5b56a8656961931b7489e4364a1f
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-10-17 13:09:18 +02:00
Mathieu Duckerts-Antoine d9cd064ef7 [FIX] web: kanban: many2one label after drop
Have a kanban view grouped on a many2one and displaying that many2one
with a widget in the record cards. Drag a record from one column to
another: a crash occurs. This happens because the record update is done
with a value of the form [id, undefined] (that is with no defined label)
and nothing is done in the kanban model to fetch that label,
making impossible to render the many2one after the update. We fix that
problem by using the known group display name as label for the dropped
record.

X-original-commit: 2a6fe373d48385485933429fbc1e6e3eabd877b4
Part-of: odoo/odoo#103271
2022-10-17 13:09:18 +02:00
luvi 8bf30a66c3 [FIX] web: fix progressbar alignment in form views
This commit fixes the alignment of the progressbar in form views. A fix
that has been introduced in commit fae1d7a3e22bb6d295ca7d0550d425a9b1af934e made
the progressbar aligned to the right in its readonly state, before turning
into edition, which displayed the field on the left. Since the right
alignment is only needed in list views, the style has been adapted to only
show the 'end' alignment on that specific case.

closes odoo/odoo#103203

X-original-commit: 297dfd5499ec50967bf28bb6bf6d1a5d9269b2b5
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Luca Vitali <luvi@odoo.com>
2022-10-14 11:40:01 +02:00
Brieuc-brd ccd45298e4 [FIX] web, loyalty: adapt mail preview for dark mode
Prior to this commit, the mail preview for gift card wasn't readable in
dark mode.

This commit fixes this issue.

task-2710677

closes odoo/odoo#103163

X-original-commit: 360e8da33fa8b1a607a96eb58fc0dcc5e1b07539
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-10-12 16:14:53 +02:00
Morgane (morm) cb16a9b3b1 [FIX] web: badge border
Prior this commit, there was a height difference between the badges with
an outline and those without it.

task-3012970

X-original-commit: 5a009fa654f40f3348217fff2014f475ce099a49
Part-of: odoo/odoo#103160
2022-10-12 16:14:46 +02:00
Morgane (morm) a5b6ba9f99 [FIX] web : field badge color
Prior to this commit, the badge hover was not readable in dark mode

task-3012970

X-original-commit: eebd6c42a8669a0c4181a59ae5b33d6bc40d6f06
Part-of: odoo/odoo#103160
2022-10-12 16:14:46 +02:00
Xavier Luyckx (xlu) e0711cbe4b [FIX] web: search, adapt mobile search for dark mode
Prior to this commit, the mobile search colors used in dark mode were
incorrect. This commit adapts the mobile search colors for dark mode.

task-3012970

X-original-commit: 5408fadba20a59ce2e186821350b56b2347f7685
Part-of: odoo/odoo#103132
2022-10-12 11:30:04 +02:00
stefanorigano (SRI) feb4b8c2ad [FIX] web: ListRenderer hover & focus states
Since Bootstrap 5.1 cell background color is controlled by CSS variables
in order to effectively handle mixed scenarios (eg. "selected + :hover +
table-info" combined).

Commit https://github.com/odoo/odoo/commit/1d4145dfda1f8a95c3f386ae01fb0e29ddd4be48 forced bg-colors for :hover and :focus states, achieving the
desired result in a simple scenario but inadvertently breaking the
behavior for complex combination and/or different color schemes
(eg. dark-mode).

This commit restore the default BS mechanics for `:hover`, and uses BS
variables to handle `:focus`.

task-3012970

closes odoo/odoo#103118

X-original-commit: 1978a5bfa08a534487d7a70921105f8b5c3a5d30
Related: odoo/enterprise#32740
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-10-12 11:29:55 +02:00
stefanorigano (SRI) 2088edaccb [FIX] web: provide border-color in primary_variables bundles
Prior to this commit it was not possible to detect/use the default
border-color in within the 'primary_variables` bundle.

This commit define a new `$o-border-color` variable to be used in BS
overrides and by components/functionalities that need it (eg. dark-mode)

task-3012970

X-original-commit: 29cd4ad3601cd6d3d86c8eaa747ddff600061c00
Part-of: odoo/odoo#103118
2022-10-12 11:29:54 +02:00
Julien Mougenot 5a7fd7fe96 [FIX] web: Enhance draggable edge scrolling
This commit does 2 things for the draggable hook builder:

- the scrollable feature will apply on the nearest scrollable parent if
the current element cannot be scrolled (removes the need to pass a
parent ref which is not the target container);

- the dragged element is now strictly bound to the current viewport or
the container ref, whichever is the smallest.

closes odoo/odoo#103137

X-original-commit: 70bdf940cc1491fd0cdbae0240d930e8a1d5b25e
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2022-10-12 10:34:55 +02:00
Mathieu Duckerts-Antoine df6c716bc2 [FIX] web: kanban: attribute default_order
Before this commit the attribute default_order was not taken into
consideration by the kanban view.

closes odoo/odoo#103127

X-original-commit: 0116b590a47c8c12354877498e576ad28e42c1f2
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2022-10-12 10:34:50 +02:00
Mathieu Duckerts-Antoine 3c434afd26 [FIX] web: list: no highlight of a column without label
Before this commit, a list header with no label and associated with a
first orderBy field would be highlighted (i.e. would have the class
table-active). Since this is visually weird, we remove that class from
such a header.

closes odoo/odoo#103108

X-original-commit: 36fb5a0d170d9f5692485d0b2fc374951794cd69
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2022-10-12 10:34:42 +02:00
stefanorigano (SRI) 47d8bf4be6 [FIX] web: daterangepicker, website conflict
The 'transparent' background value has been added by https://github.com/odoo/odoo/pull/99755 to
correctly handle color variations for the backed.
The rule was inadvertently overriding custom designs defined by
website_sale_renting (frontend).

This commit allows to inject dark-mode customization using CSS variables
, while keeping a fallback value used by the frontend.

task-3015397

closes odoo/odoo#103128

X-original-commit: 39442c8f8481d6764699236bc6e1595337dc5d1e
Related: odoo/enterprise#32744
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-10-12 01:25:14 +02:00
Pierre Paridans d98f4d2cf3 [FIX] web: add support for switch type in Burger's UserMenu
This commit adds an implementation of the UserMenu item's type 'switch'
for the BurgerMenu (used in smaller screen).

Note: this commit also adds unit tests for the BurgerUserMenu ; the
asserts are largely inspired by the regular UserMenu tests.

closes odoo/odoo#103102

X-original-commit: 0653ec8672e5878e40c804ea569dfccbd6105edc
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-10-11 18:56:14 +02:00
Pierre Paridans d2d7a280a7 [MOV] web: matching folder structure in web/tests/mobile as web/tests
X-original-commit: 6d12386ce2a82a4851d021194fa9326ff0f4b334
Part-of: odoo/odoo#103102
2022-10-11 18:56:13 +02:00
Pierre Paridans d616ade15c [MOV] web: BurgerUserMenu file should match class name
X-original-commit: 2cb344aad9f74b54cf8a125ab7ce0e41c56e44fa
Part-of: odoo/odoo#103102
2022-10-11 18:56:13 +02:00
Odoo's Mergebot eebb329fc8 [FW][MERGE] hr_timesheet,web: add owl tests and fix bugs
This PR purpose is to ensure that tests are created on OWL Components that have been created in the context of the OWL migration PR odoo/odoo#100729.

This PR also addresses some bugs that have been discovered during tests writings.

task-3001470

closes odoo/odoo#103033

Forward-port-of: odoo/odoo#101967
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-10-11 18:55:40 +02:00
Renaud Thiry 96c8dd3ca8 [FIX] web_editor: onAttachmentChange only composer
Due to a previous fix, attachments uploaded through media dialog would appear in the attachments of mail marketting.
That fix prevents attachments from 'dangling' and being garbage collected later.

That fix is now limited to the mail composer in this commit as attachments are only garbage collected for that model, for now.

related commit: c112361bf9e2f5e7b087c5e5b9a31879856b1da4

task 3003939

closes odoo/odoo#103038

X-original-commit: 69fdca133b06eb66443635bc52d380233580ef51
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-10-11 14:10:25 +02:00