Commit Graph
1451 Commits
Author SHA1 Message Date
Lucas Perais 63eb7fc023 [FIX] web: record's images correctly cached by the browser
Before this commit, images' url where just built upon the record's id and model.
Since the browser caches GET requests by url, the same record would always have the same image url.
Hence it appeared that when changing a record's image in form view, and going back
to the kanban, the image displayed was the old one.

A good enough approximation to solve this (and was actually solved in legacy code), is to use
the record's __last_update field, which basically tells the browser to re-fetch
a record's image when then record go through any modification.

After this commit, images are correctly updated in kanban and form views.

closes odoo/odoo#97544

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-08-09 08:59:53 +02:00
Aaron Bohy 39b3c6c3e6 [FIX] web: FormView: correctly eval domain involving id
Before this commit, modifiers containing conditions on the `id`
field weren't always correctly evaluated in form views. This
happened on new records, when the `id` field wasn't present in
the view. In this case, its value in the evalContext was
`undefined`, so a domain like `("id", "!=", "False")` was always
evaluated to true. The `id` field is handled a bit differently
than the other ones, as we do not require for the field to be
present to use it in modifiers (mostly because we don't need it
to be present to know its value).

This commit fixes the issue by forcing a `false` value for `id`
when the record has no id yet.

closes odoo/odoo#97587

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2022-08-08 22:15:44 +02:00
FrancoisGe 74562c8a41 [FIX] web: press a key when focusing column header
Before this commit, if the header of a column (X2many/ListView) has the
focus, a record is being edited and a key is pressed, then a crash is
displayed.

closes odoo/odoo#97559

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-08 21:02:50 +02:00
Lucas Perais 8805b7565e [FIX] web: ColorField triggers onchange when is changed
Have a color field with an onchange on it.
Change the color.

Before this commit, the onchange was not passed to the server. This was
due to the internal of ColorField, which refreshed its value to the old one
even before owl or odoo did anything.

After this commit, the call to onchange is correctly passed.

closes odoo/odoo#97476

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-08 16:01:07 +02:00
Lucas Perais b62f494c0d [FIX] web: form: click on create always opens a form in edit
Spawn a form view with a record and set its props "mode" to readonly.
Click on "Create".

Before this commit, the new record was in readonly mode.
This is never what we want, we always want a new record to open
in edit mode.

After this commit, the new record is in edit mode.

closes odoo/odoo#97451

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-08-08 16:01:04 +02:00
Xavier BOL (xbo) 03657d741d [IMP] web: add kanban option to prevent dragging columns
Before this commit, when the kanban view is grouped by m2o field, the
columns can be resequence by doing a drag and drop on one of them. In
some cases, this resequence should be disabled to keep the order of the
columns in the kanban view. For instance, in the project sharing
feature, the views are accessible by the portal users to easily follow
the tasks in the project shared but the actions allowed to the portal
user are restricted to only one model (that is `project.task` model).
So, in that case, the order of the columns should always be the same.

To avoid doing a customization code to be able to prevent the
resequence of columns in the kanban view, this commit adds a new option
in the kanban view called `groups_draggable`. By default, this option
will be true to allow the user to resequence the kanban columns
(if the field used for the group by is a m2o and not readonly).
If the option is false then the resequence of the kanban columns will
be disabled.

task-2941335

closes odoo/odoo#97447

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-08 16:01:00 +02:00
Jorge Pinna Puissant a838cac92c [REF] web: legacy_fields, standardize the parameter
Before this commit, the parameter sent to the legacy fields were
different if the field was used on the form view, or on the kanban/list
view. Specifically, the attrs were not sent when the field was use on
the form view, and the viewType was not send when the field was use on
the kanban/list view.

Now, we standardize the parameters sent to the legacy fields regardless
of the view they are used on.

closes odoo/odoo#97431

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-08 16:00:57 +02:00
Géry Debongnie fb0bebc6cf [FIX] web: add display:contents to wrapper div in fields
With the new views in owl, we wrapped every field in a div with the
class o_field_widget. This is a good thing in general, but it has the
issue that before this commit, the display property was set to
inline-block, in all cases.

With this commit, we set it to 'contents', which means that it will
simply get the correct display value from its content.

Part-of: odoo/odoo#96865
2022-08-08 12:33:11 +02:00
Géry Debongnie 130a7d9ee1 [IMP] web, web_tour: improve isVisible helper
Before this commit, the isVisible helper would most of the time work as
expected, except if an element has display: contents.  In that case, it
has no bounding box, but it may still be visible if one of its child
is visible.

This is particularly important since we want to set the display property
of all field components to "contents".

Part-of: odoo/odoo#96865
2022-08-08 12:33:11 +02:00
Fabien Pinckaers f981c5f8f0 [IMP] web: FormView: field tooltips UX
- Less Overwhelming: reduces the hover zone to an icon. Tooltip
appearances are less intrusive as you move the mouse in the screen
- More discoverable: show an icon for the fields that have a tooltip
- better UX: max-width on the popup

closes odoo/odoo#97440

Note: commit 3363e55cac reduced help messages to useful ones.
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-05 09:37:16 +02:00
FrancoisGe ed237addb1 [FIX] web: ListView click on sortable column header
Before this commit, in a list view with a record being edited, if you
click on the header of a column sortable and press a key then a
crash is displayed.

Solution:
We will unselect the record when we click on a column header
(sortable or not). It will be impossible to focus the header of a column
when a record is in edit mode. Either the record is in readonly mode,
or it is invalid and the invalid field is focused.

How to reproduce:
- Go to a list view
- Switch a record to edit mode
- Click on the header of an sortable column
- Press a key (for example "a")

Before:
    Crash is displayed, the record is still in edition and the header
    of the column is focused.

After:
    When you click on the header, the record switches to readonly mode
    and the header of the column is not focused.

closes odoo/odoo#97433

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-05 00:29:47 +02:00
Dardenne Florent (dafl) 13e9388c87 [FIX] web: restore specialData when discarding
Changed specialData (as in statusbar) were not discarded when clicking "Discard".
Now, when a form is Discarded, the specialData is restored.

Example: In project.task form view, there is a statusbar in which the domain depends on the project_id.
Edit a task, remove the project and the statusbar is updated. When discarding, the statusbar
is not restored to his initial state. Now it is restored to his initial state.

task_id: 2811530

closes odoo/odoo#97164

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-04 20:10:57 +02:00
Lucas Perais 6c155e1713 [FIX] web: relationalModel: basic keys supported in record context
Have an editable list view, displaying a many2many tags field. The m2m field
has a context, mentioning `active_id`. (`context="{'default_field': active_id}"`)

"basic context keys" is to be understood as the usual suspects: active_id, active_ids, current_company_id, active_model

Type something in the m2m input, and selet create and edit, in order to create a new record in a dialog form view.

Before this commit, there was a crash because active_id was not present in the evaluation context.

After this commit, the new record opens in its form view, with the right value for the field that must have a default.

closes odoo/odoo#96910

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-08-04 18:35:32 +02:00
Michael (mcm) b3bc5a0a03 [FIX] web: less bounce edit form button
Before this commit, the edit button in form view bounced on any click.
Now, the button bounces only when clicking in the area of a field or its label.

closes odoo/odoo#96784

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-04 18:35:29 +02:00
luvi 9c4590f6fb [IMP] web: improve ImageField style
This commit improves the style of the image widget
to use more approriate icons for edition/deletion.
Before this commit, a rectangle was covering the
entire image to highlight those buttons. Now, only
those are visible and highlighted on desktop when
hovered, while being always visible on mobile.

This will improve the visibility of this field
with views being always-edit.

task #2860958

closes odoo/odoo#97208

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-04 13:54:24 +02:00
stefanorigano (SRI) 71611ff3c0 [REM] *: drop bg-muted class in favor of bootstrap defaults
Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2918463

Part-of: odoo/odoo#97051
2022-08-04 13:54:14 +02:00
stefanorigano (SRI) 6eeecd19b5 [REM] *: drop custom bg-[color]-light classes
Drop custom `bg-[color]-light` classes in favor of BS's background
color opacity system.
ref: https://getbootstrap.com/docs/5.1/utilities/background/#opacity

Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2918463

Part-of: odoo/odoo#97051
2022-08-04 13:54:12 +02:00
FrancoisGe 054c2f21df [FIX] web: FormView with OuterGroup empty
Before this commit, if a form view has a group containing only invisible
elements and at least one invisible group, then the view crashes.

Example:
    <form>
        <sheet>
            <group>
                <group invisible="1">
                    <field name="foo"/>
                </group>
            </group>
        </sheet>
    </form>

The solution is to have an empty list as the default props for the
OuterGroup slots. OuterGroup is a group containing at least one other group.

closes odoo/odoo#97295

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-04 11:45:28 +02:00
FrancoisGe 9569438643 [FIX] web: filter_domain with an integer value
Before this commit, an error was returned when opening a view if the
view's searchArch contained a field with a filter_domain and the view's
context contained an integer "search_default_" for that field.

Example:
<search>
    <field name="m2o" filter_domain="[('m2o', 'child_of', raw_value)]"/>
</search>

context: {
    search_default_m2o: 1,
}

Part-of: odoo/odoo#97295
2022-08-04 11:45:28 +02:00
FrancoisGe 7759025310 [FIX] web: ViewButton not display error dialogs
When a ViewButton is clicked and the action fails, you would expect to
see an error dialog explaining the failure.

For example:
- go to a form view
- click on a state button which should open another view
- the new view has an issue when rendered

Result before:
    We stay on the form view and nothing happens

Result after:
    We stay on the form view and an error dialog is displayed.

Part-of: odoo/odoo#97295
2022-08-04 11:45:27 +02:00
Audric Onockx (auon) 45f26fdd43 [IMP] web: dynamic placeholder for column creation
- Purpose

Improve the UX of the "column creation" mechanism in the kanban view
so that users better understand what it is they are creating.

- Specifications

In the kanban creation mechanism, use the name of field on the model
(e.g. when grouped by stage_id in project.tasks kanban, "Add a Column"
would become "Add a Stage" because the stage_id field's name is "Stage").

task-2755570

closes odoo/odoo#95550

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-03 20:47:56 +02:00
Julien Mougenot 3faaecf1f3 [FIX] web: Make Ace editor field reactive
Before this commit, the Ace editor field did not update on props change.

Now, it will update its value and options when the props keys "value",
"mode" or "readonly" are modified.

closes odoo/odoo#97396

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-03 19:33:50 +02:00
Dardenne Florent (dafl) 455a061d09 [FIX] web: stacked bar is properly displayed
Stacked bar does not support the stacked option in the y axes.
This option was introduced in the stacked line generalization and was
set to False if the user is in the bar mode.

closes odoo/odoo#97410

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2022-08-03 16:31:11 +02:00
Jorge Pinna Puissant b348889077 [FIX] web: sort on grouped list
Since 48ef812a63, a warning was raised
(python side) when a grouped list is sorted by anything different from
an aggregate or the first field of the group.

Now, only the first field of the group or an aggregate fields can be
used to sort a grouped list.

closes odoo/odoo#97392

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-03 16:31:01 +02:00
luvi ec7fa71bc5 [FIX] web: classNames set on fields in list view
This commit fixes the case where classNames set on fields
used in list views were set on the cell instead. This was
causing style issues as some classnames could modify the
display option of the cell instead of styling the field
appropriately. As the layout could break easily, it is more
safe to only apply the classnames to the root div of field
elements.

A test has been added to verify this behavior.

Part-of: odoo/odoo#96957
2022-08-03 15:09:31 +02:00
Samuel Degueldre d2a59acc6b [FIX] web: fix image field preview not updating when uploading an image
Previously, when editing an image field and choosing a new image, the
image preview would update itself to show the selected image. With the
conversion of the image field, this behaviour was lost. This commit
restores that behaviour.

closes odoo/odoo#97370

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-03 13:45:24 +02:00
Lucas Perais 64b6b630b9 [FIX] web: views: relational_model: domain set in python has dynamic values
Define in python a domain on field in the string form containing a leaf of that style
`[('field', '=', field)]` the second field doesn't have quotes around as we want it to take the current value
of the record, JS side.

Given that the field is a m2o, click on the autocomplete to trigger a name_search with that domain.

Before this commit, there was a crash as the dynamic value for `field` was absent from the evaluation context
of the domain.

After this commit, the domain sent to name_search, or at any time, is correctly evaluated.

closes odoo/odoo#97342

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-03 12:25:39 +02:00
Michael (mcm) baea858abc [IMP] hr_timeoff,web: convert radio image field
This commit converts the radio image field of hr_timeoff
to the new framework and renames the registry key to
time_off_radio_image.

closes odoo/odoo#97103

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-03 12:25:36 +02:00
Michael (mcm) 4ce19e0c37 [IMP] web: add loadFields fn to view service
This commit adds a function `loadFields` to the view
service to load the fields of a given model and cache them.

Part-of: odoo/odoo#96852
2022-08-03 11:06:30 +02:00
Lucas Perais 8fc7aa4ff1 [FIX] web: views: translate terms with right context and domain
Before this commit, when clicking on the translate button on a translatable field,
the translate dialog had too much data, among them wrong data because the domain
to fetch them was wrong. The context was also wrong.
This lead to a crash in subsequent operations (modify and save)

After this commit, the translate dialog is usable and fetches data with the right context
and domain.

closes odoo/odoo#97280

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-08-03 06:34:12 +02:00
Lucas Perais a3f6712951 [FIX] web: form_view_tests: adapt to new eslint rules pre-commit
With the rule const preferred, let something; and assigning only once triggers an error.
let something = undefined; does the trick and is what was intended.

Part-of: odoo/odoo#97280
2022-08-03 06:34:12 +02:00
Lucas Perais 6e18fb3c35 [FIX] web: field: relational: search more: _view_ref passed in context
Have a x2many field with a _view_ref (ie tree_view_ref) in its context
Open the select create dialog (Search More) of that field

Before this commit, there was a crash because the _view_ref string was passed to the get_views
as if it were an Integer ID.

After this commit, there is no crash, and the select create dialog opens correctly.

closes odoo/odoo#97224

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-02 15:49:44 +02:00
Lucas Perais 6be7d3ee4a [FIX] web: views: basic relational model: can save without any dirty translatable fields
Be in another language, edit and save a record which has translatable fields.

Before this commit, there was a crash because no changes were done on the record, making
a programming error.

After this commit, we can edit and save a record with translatable fields without changes.

closes odoo/odoo#97240

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-02 11:49:07 +02:00
FrancoisGe f10d5b665d [FIX] web: leave a listView with an empty new record
Before this commit, in a list view, if you create a new record without
modifying it and then exit the action then your new empty record will
be saved.

This causes two problems:
- you don't want to save a new empty record
- you get a "View can't be saved" error if there is a require field

The solution is to abandon new invalid records if they have not yet
been modified.

closes odoo/odoo#97169

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-02 11:49:00 +02:00
FrancoisGe 96d7fd67e1 [FIX] web: duplicate translation alert
Before this commit, it is possible to have duplicate field names in an
alert translation.

How:
- enable multi-language
- go to a form view with at least one translatable field
- edit the value of that field
- click on save (the translate alert displays the field name once)
- edit the same field a second time
- click on save

Result Before:
The translate alert displays the field name twice.

Result After:
The translate alert displays the field name once.

closes odoo/odoo#97287

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-02 10:32:14 +02:00
Bruno Boi ab3032465c [FIX] web: invalid date/datetime value/range/domain in mockReadGroup
The mock server's mockReadGroup function would not properly compute the
value, range and domain of the returned groups for date/datetime fields.
The value should be expressed in the local timezone,
and the range/domain shoulb be expressed in UTC timezone.

Consider the following:
- a record with a datetime field of value "2016-12-14 12:34:56" (expressed in UTC)
- a user with an UTC+2 timezone offset
- a read_group with groupby "['datetime:hour']"

The corresponding group would have had the following metadata:
- value: `"12:00 14 Dec"`
- domain: `[["datetime", ">=", "2022-12-14 11:00:00"], ["datetime", "<", "2022-12-14 12:00:00"]]`
- range: `{ from: "2022-12-14 11:00:00", to: "2022-12-14 12:00:00" }`

It now has the following valid metadata:
- value: `"13:00 14 Dec"`
- domain: `[["datetime", ">=", "2022-12-14 12:00:00"], ["datetime", "<", "2022-12-14 13:00:00"]]`
- range: `{ from: "2022-12-14 12:00:00", to: "2022-12-14 13:00:00" }`

closes odoo/odoo#96946

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-02 09:19:57 +02:00
dafl-odoo cc207bbe66 [REF] web,project: stacked line chart generalization
Add stacked option on line chart.
The option already existed in Project for burndown graph, so I exported
and adapted everything concerning stacked lines from Project to Web.

closes odoo/odoo#96833

Task-id: 2929576
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2022-08-01 14:44:00 +02:00
Romeo Fragomeli a1dbac0f9b [FIX] web: adapt checkbox and boolean_toggle for BS5
In the BS5 migration, the legacy `checkbox` and `boolean_toggle` widget
were adapted but not the OWL Component.

Also, we have tweaked the old widget and the component to have better
positioning and margins.

Note:
the CSS for the print is already done in BS5
```css
@media print {
  .form-check-input {
    color-adjust: exact;
  }
}
```

Also we change `offsetWidth` by `getBoundingClientRect().width` in
`list_renderer` to avoid inaccurate rounding in columns width's
calculation.

Lastly a `.o-checkbox` class is added to the Checkbox component for a
more universal and context independent targetting.

closes odoo/odoo#96185

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-01 13:26:31 +02:00
Simon Genin (ges) a63141bbd8 [REF] web: convert ribbon widget
closes odoo/odoo#96843

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-01 12:12:11 +02:00
FrancoisGe 11d79784f6 [FIX] web: create a Record in a ListView with a context
Before this commit, in a ListView, the view context was not used when
creating a record.

This caused some problems:
- the record does not use "default_" to initialise its data
- server-side required fields that are not present in the arch and
 have a value given in the context return server errors

closes odoo/odoo#97165

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-01 10:55:56 +02:00
Jorge Pinna Puissant 52509f04eb [FIX] web: take into account invisible buttons
Before this commit, an error was raised when an invisible button was
found on a list view (for example, if it has a group).

Now, the invisible buttons are correctly managed.

closes odoo/odoo#96963

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-01 10:55:40 +02:00
FrancoisGe a4df8804f4 [FIX] web: one2many contains at least 4 lines
An X2many always has at least 4 lines. If the X2many contains less
than 4 filled lines (Record or "Add a line") empty lines are added
to make up the difference.

For example, an X2many in edit mode containing only one record:
- Line containing a record
- Line containing "Add a line
- Empty line
- Empty line

closes odoo/odoo#97070

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-29 17:12:50 +02:00
FrancoisGe 5419785092 [FIX] web: ListView invisible column base on context
Before this commit, in a ListView, a field containing an invisible
attribute using an expression to be evaluated was never displayed.

Example:
<tree>
    <field name="foo" invisible="context.get('notInvisible')"/>
</tree>
The foo column is never displayed.

The solution is to use the column_invisible modifier to know if the
column should be displayed or not. column_invisible contains the
evaluated expression of the invisible attribute by the server.

closes odoo/odoo#97066

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-29 15:53:34 +02:00
FrancoisGe be3163e608 [FIX] web: wait for onchanges to determine record validity
Before this commit, the checkValidity of a record did not wait for
the application of the current updates. This was causing crashes or
records being abandoned despite an update being in progress. It is
necessary to wait until all updates have been applied before checking
the validity of a record.

For an x2many in list mode:
- create a new line
- edit the line in a valid way
- click outside the x2many while the onchange is in progress.

Result before:
- display a crash

Result after:
- X2many correctly updated

For a list view:
- Create a new record
- edit a field of the record in a valid way
- click outside the list view

Result before:
- abandon the record

Result after:
- the record was saved

closes odoo/odoo#96725

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-29 15:53:18 +02:00
Jorge Pinna Puissant aaa7336a1f [FIX] web: btn-secondary was applied on all buttons without an
explicit-rank class

Before this commit, on all buttons without an explicit rank class (that
means, a button that don't have any of the following classes:
btn-primary, btn-secondary, btn-link, btn-success, btn-info,
btn-warning, btn-danger) the class on the props.defaultRank or the class
btn-secondary was applied.

Now, the class on the props.defaultRank or the class btn-secondary are
applied as following these rules:
-  if there is no explicit rank class and there exists a
    props.defaultRank, the class on the props.defaultRank will be
    applied;
- if there is no explicit rank class and the props forceRank is set
    (for instance, on the headers on the form view), the class
    btn-secondary will be applied;
- if the button don't have any class, the class btn-secondary will be
applied.

closes odoo/odoo#96655

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-29 09:12:27 +02:00
Romain Estievenart 5c00f30307 [FIX] web: forms inside dialog misaligned
Due to the refactor of the form view, `display:block` wasn't apply on
`o_form_nosheet` anymore; This is due to the fact that `d-flex flex-nowrap`
are now directly set in the DOM and thus has !important by default.

We now only use flex when this is not a `o_form_nosheet` element.

Steps to reproduce:
1. Open Sign
2. Click on "Send"
-> the style of the dialog form content is broken

task-2871070

Link:
https://github.com/odoo/odoo/commit/28200c5ad584e9b7f51ffcf7902c8d366b93e2de#diff-26a45bff860d45f36003c55996b92ced0762c62dcd94d5d79bf7b5e4094a1ee0R191

closes odoo/odoo#96964

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-07-28 16:40:35 +02:00
FrancoisGe 4b7b89b040 [FIX] web: duplicate blank option in selection field
Before this commit, in a field selection, it was possible to have two
blank options.

To reproduce this problem, you need to have a non required selection
field and one of the selection sent by the server has the value false.

Our solution is to ignore the false selection returned by the server
and add the false option only if the field is not required.

closes odoo/odoo#96951

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-28 13:21:25 +02:00
FrancoisGe 19c2bbfa3a [FIX] web: KanbanView multi edit
Before this commit, in a kanban view, if you try to create a new record
while another one is being saved, then a crash is displayed.

To avoid this problem, when we create a new record in quickCreate mode,
we will first wait until the first one has finished saving before
creating the new one.

closes odoo/odoo#96826

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-28 13:21:18 +02:00
Lucas Perais cea8a6adaf [FIX] views: fields: one2many open record containing another one2many
Have a form view with a one2many list with one record inside.
Click on it to open it. The form view that will open must also have a one2many list

Before this commit, there was a crash because the information of the main record's view
was not propagated to the form view of the opened record. Generally speaking, env.config was lost.

After this commit, we propagate correctly the config.

closes odoo/odoo#96618

Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-07-28 09:14:43 +02:00
Lucas Perais 6eb2238294 [FIX] tests: views: helpers: the view's env is not the global env
Before this commit in tests, when creating a view with makeView, the same env was shared for services, view and
main_components_container. This is rather wrong as bugs in prod could not be reproduced in tests.

For example: env.config was present in the env for every services and components, this is wrong as
only View must receive it in its env.

After this commit, makeView separates the env for services and top-level components from the one dedicated for View.

Part-of: odoo/odoo#96618
2022-07-28 09:14:43 +02:00