Commit Graph
16105 Commits
Author SHA1 Message Date
Xavier BOL (xbo) 6a4e3dc030 [FIX] web: allow to change the row on textarea in TextField with a prop
Before this commit, the rows attribute given on the TextField component
was always 2, it is not possible to alter it without overriding the
component.

This commit adds a props to be able to update the rows with a prop
called `rowCount` and this prop can be set via `rows` attribute set on
the field.

task-2947516

X-original-commit: 110915c80c2a2578563283b1744e0e88d80ac4bb
2022-10-10 17:03:04 +02:00
Xavier BOL (xbo) 0c35d43adf [FIX] web: check if record in component props is defined since it is optional
Before this commit, when a component using the `useInputField` hook (for
instance `TextField`) and the `record` is not given in its props, the
hook will crash since it assume the `record` is always defined. However,
the props definition the `record` is optional.

This commit checks if `record` is defined in the component before using
it to be sure to avoid any crash because it is not defined.

task-2947516

X-original-commit: ebe3d00e52dd6097ce55986bc9e3bf9d79ca64cc
2022-10-10 17:03:03 +02:00
Damien Bouvy c8d1b57b08 [IMP] web: UX changes for form status indicator
Rationales:
- having a textual display "Unsaved changes" implied to the user that they
had to save
- having buttons "hiding" behind a hover effect on a span of text was
  very unintuitive
- since we don't want an hover anymore, having text buttons would draw a
  lot of attentions => use icons + tootltip instead

closes odoo/odoo#102757

Forward-port-of: #102605
Related: odoo/enterprise#32570
Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-10-10 13:00:43 +02:00
Damien Bouvy 750a499203 [IMP] web: remove "mauve" background coloring for CE required fields
Unify UI between EE and CE by removing this rather 'in-your-face'
required fields coloring.

Forward-port-of: #102605
Part-of: odoo/odoo#102757
2022-10-10 13:00:42 +02:00
Ruben Gomes 28f96e743a [FIX] web: wrap search view options
When there is too many options inside search view, they didn't wrap and will overflow outside the screen.

closes odoo/odoo#102812

X-original-commit: 8a63d9773b14e212618c3d0d298f0926547e1045
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2022-10-10 11:57:13 +02:00
Arthur Detroux (ard) 24527568d1 [FIX] web: do not override params context keys with user_context in RPCs
Commit [1] added back the user context to every RPC called from the
legacy env when it's mapped to the WowlEnv but in doing so, overrode
the params' context keys.

This is incorrect as the params could very well have context params that
are different from the session's params for a reason.

For example, in master, after [2], editing the menus of a website
displayed in a language different from the user's will lead to incorrect
languages in the context when the page is saved. This is cause the
language in which the page is edited is passed as a context param, and
the language of the user is in the session (under the same `lang` key).

[1]: https://github.com/odoo/odoo/commit/d959638e23a92cf880049a760c42da33e5908f41
[2]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

X-original-commit: 8cdb2293f294558c3bea4ed59a49e0f52b3d217e
Part-of: odoo/odoo#102799
2022-10-10 11:56:57 +02:00
Julien Mougenot f34768a555 [FIX] web,*: Unify active actions
`activeActions` is a set of boolean values determining what actions
(i.e. 'create', 'delete', etc.) can be performed on the current view or
subview (x2many).

Before this commit, the x2many fields used a different naming convention
than the one set on the views (e.g. 'canCreate' instead of 'create').
This caused mismatches when subviews would try to rely on the parent
view `activeActions` to define their own. This also introduced a bad
design where the "type" of `activeActions` would be determined by that
same mismatch.

Another issue was that the list renderer did not always check for the
existence of activeFields in its props, despite defining them as
optional.

This commit unifies the names of the active actions accross views and
x2many fields, while adding a "type" property to it s.t. its owner
can determine what context it finds itself in.

closes odoo/odoo#102115

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2022-10-10 10:53:48 +02:00
Jorge Pinna Puissant 9d90d974d8 [FIX] web: calendar only one today on the datepicker
Before this commit, when the day of the month was smaller than 10,
multiple days were highlighted as today on the datepicker.

Now, only the correct day is highlighted.

closes odoo/odoo#102296

X-original-commit: 0545178d5d09f659d5309069ebcae9d7162356a0
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2022-10-10 09:47:52 +02:00
Laurent Desausoi 7593c073d2 [IMP] core: use inert SQL based neutralization
Before this commit the neutralize system introduced in v16 was using ORM
methods in order to change appropriate records. Although flexible, this approach
could lead to call some methods with side effects while neutralizing
(eg: overloads of write).

This patch converts the neutralize system to a safer "inert" SQL based approach
by migrating the generic method _neutralize to SQL files exposed in the
data folder.

Task id: 2961687

closes odoo/odoo#102792

X-original-commit: e5dbded9bb363351feff7ca8a56c7f8a6860f492
Related: odoo/enterprise#32580
Signed-off-by: Fabien Meghazi <fme@odoo.com>
2022-10-09 22:04:00 +02:00
Denis Ledoux 94e05f9eed [IMP] base, web: do not set on_change="1" on most views
Only kanban, tree and form implements onchanges.
Therefore, on calendar, graph, pivot, ..., putting `on_change="1"`
is useless and is a waste of resources and KB.

e.g. CRM lead pivot view

Before:
```xml
<pivot string="Pipeline Analysis" sample="1">
    <field name="create_date" interval="month" type="row"/>
    <field name="stage_id" type="col" on_change="1"/>
    <field name="expected_revenue" type="measure"/>
    <field name="color" modifiers="{&quot;invisible&quot;: true}"/>
    <field name="automated_probability" modifiers="{&quot;invisible&quot;: true}"/>
    <field name="message_bounce" modifiers="{&quot;invisible&quot;: true}"/>
    <field name="probability" on_change="1" modifiers="{&quot;invisible&quot;: true}"/>
</pivot>
```

After:
```xml
<pivot string="Pipeline Analysis" sample="1">
    <field name="create_date" interval="month" type="row"/>
    <field name="stage_id" type="col"/>
    <field name="expected_revenue" type="measure"/>
    <field name="color" modifiers="{&quot;invisible&quot;: true}"/>
    <field name="automated_probability" modifiers="{&quot;invisible&quot;: true}"/>
    <field name="message_bounce" modifiers="{&quot;invisible&quot;: true}"/>
    <field name="probability" modifiers="{&quot;invisible&quot;: true}"/>
</pivot>
```

I would have like something smarter, like using the `editable` concept
for instance, but it's not that easy.
e.g. kanban is not considered as editable, while it does support
onchanges when grouping record by a field and drag and dropping
record from one column to another.
However, if we change the kanban view to make it editable,
the view validation will start validating the fields domain:
https://github.com/odoo/odoo/blob/45d4ac14f65c53dcde56592715d50169bde116ad/odoo/addons/base/models/ir_ui_view.py#L1439-L1442
causing issues:
- If a field used in the domain is not in the view, it will need to be
  added in the view,
- while it will not be used, as you cannot do a search in related fields
  in kanban views anyway.
e.g.
```
odoo.tools.convert.ParseError: while parsing /data/build/odoo/addons/analytic/views/analytic_line_views.xml:120
Error while validating view near:
<kanban class="o_kanban_mobile" __validate__="1">
                <field name="date"/>
                <field name="name"/>
Field 'company_id' used in domain of field 'account_id' ([('company_id', 'in', [company_id, False])]) must be present in view but is missing.
```

In addition, the kanban doesn't need the readonly and required
attributes on the field nodes, as other editable views (tree and forms)
do.

In addition, the tree list is currently considered as "editable" only
when it has `editable="bottom" or `editable="top"`, while
a tree without this editable attribute can still trigger onchange,
for instance when using `widget="handle"` or `widget="boolean_toggle"`.
We should therefore making the tree list editable whatever the case,
leading to the same issues than listed for the kanban above,
or make an exception for field in non-editable tree views using a
widget..

So, as the smarter way seems difficult and risky, for a limited gain
I choose the easy way by separating the concept "editable" and
"onchange-able" and to not set `on_change="1"` on views not considered
as "onchange-able".

closes odoo/odoo#102788

X-original-commit: aeb65ee536b1611c1cb829c91906f327f8e331c7
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-10-09 21:07:47 +02:00
qsm-odoo d134987f21 [FIX] web: make smooth scrolling during drag&drop work with BS5
Since BS5, the <html> receive the 'smooth' CSS value for the
'scroll-behavior' property. As the name indicates, it makes scrolling
smooth (on click on anchor link for example) instead of an instant
jump (although the exact behavior is left to the browser).

The problem is that this auto-smooth from the browser conflicts with
the "smooth drag and drop" code (at least if the scrolling target is
actually the `<html>` element which is never the case currently). Indeed
this code expects to make small instant jump depending on the position
of the user cursor. This commit solves the problem by disabling the
browser auto smooth for the duration of the drag and drop.

Note: a further commit will move back the scrollbar behavior out of the
`#wrapwrap`, this is thus especially needed.

Note: this bug fix could be back-ported, should the need arise (custo
might want to use the 'smooth' 'scroll-behavior' in stable without BS5).
Although the only side effect is slower smooth drag and drop.

X-original-commit: 81ed9bee81bacca7b55598e9af7cac51cd7805cf
Part-of: odoo/odoo#102785
2022-10-09 18:52:49 +02:00
qsm-odoo 0783f7ca71 [FIX] web: properly handle smooth drag and drop for iframe normal scroll
The smooth drag and drop in edit mode (over the website iframe)
currently works correctly. This would not be the case if the scroll was
not on the `#wrapwrap` but left to the `<html>` element. Indeed, special
code handles that case, but that code is actually not needed in case
what is being dragged is outside an iframe and that the smooth
scrolling is performed inside that iframe.

Note: a further commit will move back the scrollbar behavior out of the
`#wrapwrap`, this is thus especially needed.

X-original-commit: 4947ef118c646171fd3358135dcab8f63efa04d2
Part-of: odoo/odoo#102785
2022-10-09 18:52:49 +02:00
qsm-odoo 09ef0e4663 [FIX] web: make scroll utils properly work with website iframe action
The `scrollTo` method and related utils (jQuery animate, ...) were not
properly adapted to work in the context of multiple documents. E.g. the
website editor code (outside the website iframe) is calling the
`scrollTo` util to scroll to added snippet elements (inside the website
iframe). In that case, the util was performing some searches in the DOM
outside of the website iframe while it was meant to be done inside. The
result was that the scroll was not considering the website fixed navbar
and scrolled "too far".

Another bug is visible only when the scrollbar is left to be the natural
browser one (not on the `#wrapwrap`). In that case, the `scrollTo` util
simply had no effect anymore as the `animate` override of jQuery was not
adapted.

Note: a further commit will move back the scrollbar behavior out of the
`#wrapwrap`, this is thus especially needed.

X-original-commit: ab417de98068afaaa12995726c7c6445f075ca4f
Part-of: odoo/odoo#102785
2022-10-09 18:52:48 +02:00
qsm-odoo e54ade4ca5 [IMP] web: allow dom util of getScrollingElement to use document param
X-original-commit: a77e9984e59e1624ee198647005da3039eea42e1
Part-of: odoo/odoo#102785
2022-10-09 18:52:47 +02:00
Joseph Caburnay 998914d29f [FIX] web: lighter hover highlight
closes odoo/odoo#102751

X-original-commit: 1d4145dfda1f8a95c3f386ae01fb0e29ddd4be48
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-10-09 10:08:56 +02:00
Damien Bouvy 906bc28737 [IMP] web: make inline numeric fields a reasonable size
Inline fields for numeric and date values shouldn't be as wide,
since they tend to be 'close by' another field (e.g. currency,
periodicity, etc.) in the same 'row' or included in a text zone - in
which case we want the value to be closer to its context, and not
completely isolated in a huge area.

closes odoo/odoo#102775

X-original-commit: 5f5729f8ba79c7919774021310208d41cb8ddb56
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-10-08 19:55:57 +02:00
Lucas Perais c93eb01ec4 [FIX] web: form: no "oh snap" dialog on error in dialog
Have a form view in a dialog (action in target=new)
The create/write of that model throws an error.

Before this commit, the "Oh snap!" dialog was displayed, but makes little sense
in a dialog.

After this commit, the old UserError dialog is displayed.

closes odoo/odoo#102764

X-original-commit: d36f1708219f63fae5a86b6c1e81b328ca96b347
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-08 18:57:13 +02:00
FrancoisGe 943e672d35 [FIX] web: discard invalid row in list view
Before this commit, in a list view, if you clicked the discard button
for an invalid row, it would not be discarded and the discard button
would disappear.

Why did this happen?
Invalid fields in the record were not deleted.

How to reproduce?
- Go to a list view with a required char field
- Edit the char field of a record with an empty string
- Click outside the record (it becomes invalid)
- Click on the discard button

Before this commit:
The record is not discarded (its values do not change and it remains
in edit mode) and the discard button disappears

After this commit:
The record is correctly discarded and the discard button disappears

closes odoo/odoo#102763

X-original-commit: 73ba2217ec56819ff979020a43d0c13f8ff0b697
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-08 18:57:10 +02:00
Simon Genin (ges)andJulien Mougenot 8d535edd9f [IMP] web: add edge scrolling behavior to useMakeDraggableHook
In house implementation of automatic scoll when dragging an element to
the edges of its container.

closes odoo/odoo#102756

X-original-commit: 290a6213a6e36fc2e5d11216b59a6aaf79554196
Related: odoo/enterprise#32568
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Co-authored-by: Julien Mougenot (jum) <jum@odoo.com>
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
2022-10-08 13:30:07 +02:00
Simon Genin (ges) 2e8d9cdf18 [FIX] web,*: fix kanban useSortable screen width limit
Reproduce:
Go on a kanban view, with enough columns so it goes off the screens.
Scroll on the right, try to drag anything beyond the original (before
scrolling) limit of the screen. The cards are stuck floating at that
limit. Note it didn't prevent the drop to work properly where the mouse
was.

Issue:
The useSortable hook gets an owl ref, which is used as a limit to where
things can be dragged and dropped. Originaly and logically, it was the
current component ref, the renderer. But for some unknown reason, this
space was not getting wider than the initial screen size. It may be a
problem with the flexbox layout.

Tried solutions:
- A first solution was to add the overflow-x-scroll css property to the
renderer. It works, but now the horizontal scroll bar is no longer
always visible. You have to scroll all the way down to see it. UX wise
this is not acceptable.

- We could remove the clamp mecanism inside useSortable to let the drag
and drop motion go anywhere. This works, but decrease the quality of the
interaction. It looks cheap and not polished.

Final Solution
Finally, we decided to pass a ref to the o_content div from the layout
component down to the kanban renderer. If the useSortable is given this
ref, it works as intended. While it may seem too much, it is not
unreasonable to propose a reference to the most parent element of the
view contents to the renderer.

X-original-commit: a569305acaa1c812ede739c267e2e9530945f65f
Part-of: odoo/odoo#102756
2022-10-08 13:30:07 +02:00
Pierre Paridans 81defa2804 [FIX] web: ListView footer columns with optional field
This commit fixes the number of cells created in the ListView's footer
when the optional field's button is present.

Steps to reproduce:
- Open Accounting > Customer Invoices
- Switch to ListView
=> the footer (containing totals) has one less cell

closes odoo/odoo#102222

Forward-port-of: odoo/odoo#101954
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-10-08 13:30:04 +02:00
Pierre Paridans 1233ff1b18 [FIX] web: ListView group's pager position
This commit fixes the pager's position in a grouped ListView when the
optional field's button is present.

Steps to reproduce:
- Open Account > Intrastat Code list
- Unfold "Commodity" group
=> The group's pager is misplaced

Forward-port-of: odoo/odoo#101954
Part-of: odoo/odoo#102222
2022-10-08 13:30:03 +02:00
Romain Estievenart 97533b6d8d [FIX] web: text overflow ellipsis appear on trash
Add missing exclusion `o_list_record_remove` class used to allow text
overflow mixin.

Steps to reproduce:

- Open the Employee app
- Plan creation
- The trash as an overflow ellipsis => bug

closes odoo/odoo#102758

X-original-commit: a2ee880237724463b90fc43df69b689b82756fe4
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Romain Estievenart (res) <res@odoo.com>
2022-10-08 12:31:55 +02:00
Romain Estievenart 151d53c40b [FIX] web: kanban state column text overlap when resize on list view
Allow `o_state_selection_cell` to have the overflow mixin to allow the
resize of the kanban state column on list view without text overlapping.

This commit follows https://github.com/odoo/odoo/commit/e22abffdc230c2ae494a85fdf7fd8d6b488be3ea

Steps to reproduce:
- Open the helpdesk app
- Click on VIP Support tickets
- Go to the list view
- Check the kanban state column and try to reduce it's size
  => The text is overlap

X-original-commit: a9f83d6d2e9f53a6a562044303c5bcb5ab5f1a9c
Part-of: odoo/odoo#102758
2022-10-08 12:31:55 +02:00
Lucas Perais 1a61853d7d [FIX] web: InnerGroup: a row can have visible and invisible cells
Have an InnerGroup which has a first div visible all the time
and a second div conditionally invisible.

Before this commit, when the second div was invisible, the first was not
displayed.

After this commit, the two divs are displayed correctly.

X-original-commit: c69836e3c53e1efb61f66612c266a31aa9b54816
Part-of: odoo/odoo#102578
2022-10-08 12:31:40 +02:00
Pierre Paridans 692b4e93ec [FIX] web: properties field matching group's alignment
This commit fixes the properties field alignment to make it more similar
to the form's group layout (using grid and its gap).

Steps to reproduce:
- Open CRM
- On a lead's form view
- Add properties
=> labels from second column aren't aligned with fields above

closes odoo/odoo#102730

X-original-commit: 5a1c14fe5761e964a2370883bf209b474e498918
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-10-08 09:42:47 +02:00
FrancoisGe 0c34d94177 [FIX] web: edit domain field with invalid value
Before this commit, editing a domain field with an invalid value
for the field type will display a parsing error.

The purpose of the commit is to reintroduce the old behaviour of the
field, it should not display an error.

How to reproduce?
- Go to a form view with a domain field (in_dialog=True)
- Click on the "Edit Domain" button
- Add a domain comparing a field of type int with "01/01/2000"

Before this commit:
 An error is displayed.

After this commit:
 The domain is applied with the wrong value.
 If the server considers the domain to be false, then "Invalid domain"
 is displayed.

closes odoo/odoo#102753

X-original-commit: 7f22512149f5d634306cf0b280d055a60ba9e356
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-08 07:51:45 +02:00
luvi 85b3d7d257 [FIX] web: open date(time) picker on label click
This commit fixes the behavior of date, datetime and daterange
fields. It was no longer possible to open the date/datetime picker
by clicking on the corresponding label, since the inputs were
missing the id attribute associated with the label.

Now, it is possible again, and hovering the label will correctly
highlight the input border of the field.

Tests have been added too, to make sure this works properly.

closes odoo/odoo#102742

X-original-commit: 0e35d2b995165cfcb50db7eaec44cce7547eb4e4
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Luca Vitali <luvi@odoo.com>
2022-10-08 07:51:43 +02:00
Simon Genin (ges) d1f7192f09 [FIX] web: basic model: field context on m2m operation
When a m2m field add a context in its arch, it's passed through to the
rpcs made to the server. In a m2m situation, while the name_search
worked properly, the read operation on a dropdown item select did not
provide this context.
This PR fixes that.

closes odoo/odoo#102741

X-original-commit: 5c7066fc064ecc175104603d524b52991678a2cd
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-08 07:51:40 +02:00
Julien Banken 558aa9445f [IMP] web: add config to disable autofocus of the view search bar.
In Knowledge, we would like to disable the autofocus of the view search
bar when the view is embedded in an article. Disableling the autofocus
will ensure that:

1) The cursor of the user will not be teleported to the view search bar
   when loading an embedded view.
2) The autofocus will not trigger a page scroll when the view search bar
   is not visible on screen.

To disable the autofocus, we will simply add a new key in the default
configuration of the view. By default, the autofocus of the view search
bar will be active as it was the case before.

task-3004117

closes odoo/odoo#102724

X-original-commit: 1e9de9787613acb1066171568c5beb774235eea6
Related: odoo/enterprise#32543
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-10-07 23:59:29 +02:00
Pierre Rousseau 19e5870dae [IMP] web: ModelFieldSelector: allow to select a specific item
With this revision, we are now able to select a specific line item.
Useful especially in tests.

Part of task-id 2987871

X-original-commit: c8c7afc1e81c2e7de6b32de5db41d8f3d83a005c
Part-of: odoo/odoo#102688
2022-10-07 19:45:12 +02:00
Aaron Bohy 8540aad29f [REM] *: remove legacy views converted to owl
This commit removes legacy views that are not used anymore as they
have been converted to owl. They could actually have been removed
in the commit that converted them, as we never needed to have a
double implementation of views, unlike we need to (field) widgets.

The LazyColumnList is a special case. This view hasn't been
converted. Instead, it has been decided not to use it anymore.
So it was dead code, and this commit removes it.

The form/list/kanban views are no longer necessary in the view
registry, since their owl version exists. However, we kept them
in the test asset, as they are massively used in legacy tests
(in field tests for instance).

closes odoo/odoo#102634

X-original-commit: 186a8b31161fc8c75b346ff97f9403dca1ae677e
Related: odoo/enterprise#32501
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-07 17:47:58 +02:00
Samuel Degueldre 6df381527f [FIX] web: align progressbar to the right of the field
closes odoo/odoo#102611

X-original-commit: fae1d7a3e22bb6d295ca7d0550d425a9b1af934e
Related: odoo/enterprise#32487
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-10-07 14:37:39 +02:00
Samuel Degueldre 3ca0c506ba [FIX] web: fix percentage pie field broken style
The percentage pie field was broken in enterprise, because the rules
that it needs are overwritten in enterprise but scoped to the legacy
version only.

This commit moves the community rules so that they always apply and are
not overwritten, it also removes an extra level of wrapper on the field.

X-original-commit: e3dfb1bbaa7aa2bf2bed62fb278e09c739503f4b
Part-of: odoo/odoo#102611
2022-10-07 14:37:38 +02:00
Romain Estievenart f0b4171873 [FIX] web: text overflow isn't ellipsis on list view
Add missing `o_list_activity_cell` class used to allow the text overflow
and a rule to applies the o-text-overflow mixin on their spans child

Steps to reproduce:

> Open the helpdesk app
> Click on VIP Support tickets
> Go to the list view
> Reduce the size of `Assigned to` or `Activities` column
  => The displayed text isn't ellipsis

closes odoo/odoo#102608

X-original-commit: fabc5350904c207bda6e7cdffbae0d7309769e89
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-10-07 14:37:28 +02:00
fdardenne 91a842bde6 [FIX] web: currency field: correctly align currencies
before, currencies were not aligned properly with the input field.
now, it is properly aligned.

closes odoo/odoo#102607

X-original-commit: 4be4d11d75f6a211685d122b6e1f2b97476c5416
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Signed-off-by: Dardenne Florent (dafl) <dafl@odoo.com>
2022-10-07 14:37:24 +02:00
fdardenne c872b9d448 [FIX] web: currency field: always display currency to the left
X-original-commit: e57521e059f318cfbd6d4af1b693013250f6874d
Part-of: odoo/odoo#102607
2022-10-07 14:37:24 +02:00
Sébastien Geelen (sge) e483ae5fb4 [FIX] web,web_editor,mail : Fix ModelFieldSelector and DynamicPlaceholder
Add missing feature of the ModelFieldSelector popover :
* keyboard navigation
* additional debug value
* add default value page ( for dynamic placeholder)
* add validate callback

Migrate dynamic placeholder to be compatible with new OWL field.

task-2978722

X-original-commit: 929108e29168058fad5da85e0ff9c66d2c5b2525
Part-of: odoo/odoo#102603
2022-10-07 14:37:20 +02:00
stefanorigano (SRI) df6373970c [IMP] mail: topChatter, review design
task-3005130

Part-of: odoo/odoo#102528
2022-10-07 14:37:01 +02:00
stefanorigano (SRI) db86a64047 [IMP] web, sale_timesheet: review cp design
task-3005130

Part-of: odoo/odoo#102528
2022-10-07 14:37:00 +02:00
FrancoisGe 5cf5e8fdd3 [FIX] web: restore open notebook page
The purpose of this commit is to allow the restoration of open pages
in notebooks of a form view when switching view.

How to reproduce?
- Go to a form view with a notebook.
- Select a page in the notebook
- Go to another view
- Use the breadcrumb to go back to the previous form view

Before this commit:
The page opened in the notebook is the default one (the first one
or the autofocus one)

After this commit:
The page opened in the notebook is the one previously selected

closes odoo/odoo#102468

X-original-commit: 160c0347526612b6e6f93b8079eeb868d37d48f4
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Georis François (fge) <fge@odoo.com>
2022-10-07 14:36:52 +02:00
FrancoisGe 106dc30beb [FIX] barcodes: barcode_trigger does not work in the new view
Before this commit, in new views, it is no longer possible to click
on buttons with barcode_trigger="..." using a barcode scanner.

Why:
New views no longer propagate all attributes to the button.

How to reproduce:
- Go to a form view with a button with barcode_trigger="doit"
- Scan "O-BTN.doit", "Enter".

Before this commit:
 Nothing happens.

After this commit:
    An event click is applied to the button.

closes odoo/odoo#102423

X-original-commit: b4cb2ee2662173e08f671eb736130f8332265de7
Signed-off-by: Georis François (fge) <fge@odoo.com>
2022-10-07 14:36:49 +02:00
fdardenne 26c550d75a [FIX] web: accentuate the carret contrast
Before, carret was not contrasted enough which made it less visible.
Now, it's more contrasted and visible.

closes odoo/odoo#102564

X-original-commit: 49ffc05da315a9060233c9960038dd0b36a54d91
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Dardenne Florent (dafl) <dafl@odoo.com>
2022-10-07 13:37:19 +02:00
Samuel Degueldre 89013fa42a [PERF] mail, web: accelerate page loading by lazy-loading emoji data
Previously, the emoji data that is used in the emoji grid was part of
the main assets bundle. This file is almost 500kB and the data it needs
is only needed when opening the emoji grid. This commit moves this file
into its own bundle and only loads it when opening the emoji grid
instead.

This PR also batches the inserts in the emoji model, bringing the time
it takes to do those inserts from ~8000ms to ~800ms.

closes odoo/odoo#102562

X-original-commit: e272e4fc6abce3153cce3748d8a5a7df63565916
Related: odoo/enterprise#32468
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-07 13:37:11 +02:00
FrancoisGe 9c8bff35be [FIX] web: throw an error when saving a record in a list view
Before this commit, in a list view, it is possible to have two records
in edit mode at the same time if an error is thrown when saving
the editedRecord.
The editedRecord is the only list record that can be in edit mode.

Why:
If a server error is returned when saving the editedRecord, then it
stays in edit mode but is no longer considered the editedRecord of the
list. It is therefore possible to switch another record to edit mode.

Solution:
The record that fails its save due to the error should stay the
editedRecord of the list.

How to reproduce:
- Go to a list view
- Edit a record
- Click on another record (the "write" operation returns an error)
- Close the error dialog
- Click again on the other record

Before this commit:
Both records are in edit mode

After this commit:
Only the edited commit is in edit mode.

closes odoo/odoo#102560

X-original-commit: 77092167cf8f8fca11a39005d720fa82abeec0ae
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-07 13:37:09 +02:00
Bruno Boi 751ed08c3b [FIX] web: nested x2many context fix
- Before this commit
Suppose that in a form view, there is an x2many list view
that would open a form view dialog when edited.
For the dialog to open, the concerned record is duplicated and
passed in props to a FormRenderer.
Now suppose that this form view dialog also has an x2many list
view rendered somewhere: the StaticList datapoint attached to
this list will have the same context as its parent.
This is not what we want because some of the keys of the context
does not make sense with the list's model.
In fact, it has led to tracebacks to be displayed in case of we want
to open a record of this list in another form view dialog.

- After this commit
When those lists are created, their context are cleared from
their parents' keys starting with "default_" or ending with "_view_ref".

closes odoo/odoo#102557

X-original-commit: 1ba468706295f651105ca3fc8aae477b4f05c28e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2022-10-07 13:37:07 +02:00
Bruno Boi 26ea19804c [FIX] web: make mobile viewswitcher look normal
# Before this commit
The viewswitcher in mobile would take the whole width of the device.

# After
Fixed

# Explanation
The dropdown menu is positioned through the usePosition hook.

For this hook to compute a position, 019bbef
ceiled all the compared values.

But it may occur cases where the comparison was missed by a pixel.

Here we relaxed those comparisons in
manner that they may sometimes be off from 1 pixel, but at least the
positionment behaviour will be better.

closes odoo/odoo#102548

X-original-commit: 4c82a2bba675c71b57001fda0c2e242ddba99997
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2022-10-07 12:41:24 +02:00
Bruno Boi 8076a16d17 [FIX] web: align searchmenus when no view switcher
# Before this commit
The searchmenus are aligned to the right when there is no view switcher.

# After this commit
They are aligned to the left

X-original-commit: 2a167da8096730c2bf4348e19649a0f957144b6d
Part-of: odoo/odoo#102548
2022-10-07 12:41:24 +02:00
Bruno Boi 3272317476 [FIX] web: properly align the cp_bottom_right
The commit e88988f mistakenly changed a scss rule
for the control panel bottom right section.

This commit reverse that.

X-original-commit: cc3bf7f736fe5778b4a93f1b439221557d2c8564
Part-of: odoo/odoo#102548
2022-10-07 12:41:24 +02:00
Romeo Fragomeli a918e7bf37 [FIX] web: width: 100% on .o_field_widget in a group
Restore the old CSS rule:
```css
.o_form_view .o_group .o_field_widget {
    width: 100%;
}
```
Also note that since grid, ´.o_inner_group´ doesn't have the
´o_group´ class anymore.

closes odoo/odoo#102533

X-original-commit: 98dc0b9b9c17354d03714cb51fd3e310f16bef6a
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-10-07 11:13:10 +02:00