Commit Graph
1717 Commits
Author SHA1 Message Date
fw-bot d019c002a7 [FIX] web: fix form view "More" button
In form views, when the window size is too small, a "More" button
appears and it should contain the overflow buttons.

On all browsers, the "More" dropdown doesn't contain the expected
amount of buttons, so it is shifted on the second line.

Before this commit:

    - The "More" dropdown doesn't contain the expected amount of
      buttons, so it is shifted on the second line.

After this commit:

    - The "More" dropdown contains the expected amount of buttons
      and it is not shifted on the second line anymore.

OPW-2079694

X-original-commit: 2bda8230fba07a229fcda77a1528694a0e317917
2019-10-31 11:06:51 +00:00
Lucas Perais (lpe) 9d2e3fcd61 [FIX] web: list: optional field dropdown expands toward the list
Be in RTL mode, on a list view
Click on the button to set up optional fields

Before this commit, the dropdown expanded to the right, and was partly invisible

After this commit, we dynamically set to which direction the dropdown should expand
depending on RTL/LTR
Consequently the dropdown is fully visible in either mode, and expands to the list
rather than away from it

closes #39402

closes odoo/odoo#39628

X-original-commit: fb914d176de5a4711f11de32945ebaec0164f62e
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-10-31 10:17:57 +00:00
Lucas Perais (lpe) 1d40e94011 [FIX] web: calendar: fetch records in right timezone
Before this commit, the calendar searched records on the wrong time ranges
which did not take into account the timezone of the user
It obviously resulted in some records not being there

After this commit, all the relevant records are fetched according to the right
time range in UTC, corresponding to start/end of the week/month/day of the calendar

OPW 2076114

closes odoo/odoo#39466

X-original-commit: 0f10927efe490bd82e7c23e0fc646dd6c8de2d27
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-10-28 15:49:14 +00:00
svs-odoo c5fbb9cc23 [IMP] web: add widget signature
Adding a new widget to display a sign button in the form view.

task-1878607
2019-10-28 10:46:06 +00:00
Julien Mougenot e8d300723f [FIX] web: list: recompute default values for columns when visible
Before this commit, all the computation of the default widths for column
headers was done before the list was attached to the DOM, meaning that no
column was actually visible. This was a problem since columns that are
meant to stay unseen were taken into account in the calculation of relative
column widths.

Now, the same algorithm runs once the columns are visible so that invisible
columns can be properly excluded.

fixes #38744

Task 2076721

X-original-commit: 4bf98b47898b075049975dfe597f0fb92c7c14d1
2019-10-24 06:39:46 +00:00
Julien Mougenot 337fd81157 [FIX] web,mrp_subcontracting: list: remove width attribute for button
Before this commit, the `width` attribute was interpreted by a jQuery node generator
function as a `style="width"` property and gave an incorrect width value to the affected node.

Now, the `width` attribute is automatically plucked in the list renderer in the
specific function used to render buttons.

Task 2076721

X-original-commit: c67b36c00ca263f51e0dd49d6e38702c4d614289
2019-10-24 06:39:45 +00:00
Victor Feyens e92d302d2f [FIX] web: kanban archive / unarchive all
Since https://github.com/odoo/odoo/commit/f896afcc8a54eae3efcdf034e3fd256942f7fa78,
(un)archive all triggered toggle_active on all records, which doesn't consider
whether we want to archive/unarchive and on which records...

Closes #38903

closes odoo/odoo#39022

X-original-commit: 2c89cb0c92fc593e2e323e322c9228de268f64cf
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2019-10-18 10:25:58 +00:00
Xavier-Do d65fcfecb6 [FIX] web: avoid expensive 404 during js tests
A 404 will take 3 to 5 seconds to be resolved and execute +- 1900 query, to return
a rendered page which is quite expensive, especially when multiple missing images
are rendered in a view.

Catching static route and marking them as not frontend will help to avoid to handle miss
on static resources. In this case server returns a standard 404.

This commit also fix a iframe src in order to avoid a 404 on
/web/(test )/report/html/some_report (thx to aab-odoo)

X-original-commit: 818d0cb59fbae78d0edf06318082981f318e4db7
2019-10-17 17:10:06 +00:00
Lucas Perais (lpe) a4910628b3 [FIX] web: date[time] custom filter format
In a list view, create a custom filter involving a date or datetime field

Before this commit, the domain that was sent to the server
contained the date or datetime as the pure string
representation that Moment.js constructs
that is a ISO compliant one, containing info on timezone

After this commit, the format is the one of the server, in UTC
and NOT ISO compliant. Also, the format for date is dealt with

OPW 2085936

X-original-commit: 1f1fa173c38dae105637edeb3a1e856e9748a14f
2019-10-17 10:50:03 +00:00
Debauche Stéphane e981e3312d [IMP] web: many2many_binary, binary, image, add the option `accepted_file_extensions`
Purpose
=======
We want to add an option on the widgets
- many2many_binary,
- binary,
- image

This option specifies what file extensions the user can pick from the file input dialog box.

Examples
========
```xml
<field widget="many2many_binary" options="{'accepted_file_extensions': 'image/*'}"/>
<field widget="many2many_binary" options="{'accepted_file_extensions': '.png,.jpeg'}"/>
<field widget="many2many_binary" options="{'accepted_file_extensions': 'application/pdf'}"/>
<field widget="image" options="{'accepted_file_extensions': '.png,.jpeg'}"/>
<field widget="binary" options="{'accepted_file_extensions': '.pdf,.svg'}"/>
```

How
===
Add an option (accepted_file_extensions) in the template ``HiddenInputFile`` (the widget many2many_binary is using this template)
So, we can also use this new option in others widgets using ``HiddenInputFile``
In the many2many_binary, read the ``nodeOptions`` and set the widget attribute ``accepted_file_extensions``

We also have to fix some other widget, because an property ``image_only`` was already existing in the template ``HiddenInputFile``
(we just need to replace ``image_only=True`` to ``accepted_file_extensions='image/*'``

The widget ``FieldPdfViewer`` (pdf_viewer) now use the new option to filtrate PDF
(instead of removing the <input/> and adding <input accept='.pdf'/>).

Tests
=====
We also test if the option is correctly set on the <input/>
- binary
- image
- many2many_binary

Impacted widgets
===============
- many2many_binary
- image: this widget use ``options="{accepted_file_extensions='image/*'}"`` instead of ``image_only=True``
- tablet_image: same as ``image``

Task #2082815

closes odoo/odoo#38351

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-10-16 13:57:49 +00:00
Quentin Nicolay d59b67a915 [FIX] web: add 'no_edit_color' option to many2many_tags
This option, if set to True, prevents the user from modifying the
color of the tags.

Part of task 2070454

closes odoo/odoo#38848

X-original-commit: a62b65a8f9114493064d4efae92825814a880c04
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-10-16 08:26:10 +00:00
Romeo Fragomeli 547d2d87fc [FIX] web: not possible to show a notification via client action
Before this commit, it was not possible to show a message using a client
action. (e.g. show a success message only with core in Python)

Now, it's possible using a client action. This client action call
displayNotification and so we can use the same options also.

A test is added to be sure that this action do not change the current action

Note: in the future a custom registry may be created in a refactoring
to specific function action registry.

X-original-commit: 8775fd670b6b3ec19a77fc0eab72d2223baa36c8
2019-10-14 12:11:23 +00:00
jbm-odoo 3fa123d69f [FIX] web: List editable top select last row
Before this commit, when we have a list (editable top) in a form
with some mandatory fields and some existing rows. If we click on
'add a line', a new empty line appear on the top, then we click on
the last row, the empty row will disappear and we will have a
traceback.

After this commit, if we repeat this scenario, we click on the last
row, we will be able to edit this last row.

closes odoo/odoo#38471

X-original-commit: 996f77b03eaf6dd646b1816e7f70209d5ee6f8df
Signed-off-by: jbm-odoo <jbm-odoo@users.noreply.github.com>
2019-10-11 09:15:09 +00:00
svs-odoo 88cd1f1c12 [FIX] web: rename test files correctly
Rename `signature.js` to `signature_tests.js`.
Rename `special_fields.js` to `special_fields_tests.js`.

closes odoo/odoo#29501

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-10-11 08:05:07 +00:00
fw-bot bc4b7c5036 [FIX] web: can't edit subscription with end date beyond 200 years in the future
-Import a subscription with end date beyond 200 in the future (ex: 2500-01-01).
-Open the subscription and click the Edit button.

Before this commit:

A stacktrace appears indicating that a date is not valid. It's not possible to
edit the subscription.

After this commit:

The maxDate of the date picker has been increased to 31/12/9999, allowing the
user to edit subscriptions whose end date is that far in the future.

A test `toggle datepicker far in the future` for this case has been created.

closes odoo/odoo#38527

Opw: 2079696
X-original-commit: 32b6131c04fef7a542a0ccbdb924d177627bfe38
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-10-11 16:12:34 +00:00
Romain Derie 9bbf57f915 [REM] web: remove unused controller /apps/<app>
This controller never really worked in the last 3 versions.
It was fixed in 11.3 with e9350993ca but broken with refactoring in 12.0 at a
higher level with 19eacf7d23.

It was even worse in 13.0 as it was leading to a traceback: `view_type` field
got removed with 3cd7ed07a2 but this controller was still reading that
field.

closes odoo/odoo#38355

X-original-commit: a5c4e262449fef03d05d5250e4523832db5fbf00
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-10-10 08:56:22 +00:00
fw-bot 126788ec14 [FIX] web: list many2one quick-create
Allows the quick create on m2o in list views

Before this commit, when entering a new value in a many2one in a list and
exiting the cell through a click, the quick-create modal appeared for the
duration of the mousedown.

Now, the modal remains and allow to edit the new many2one value

Task 2076380

closes odoo/odoo#38289

X-original-commit: c00f84eb0a176b8d23927080078eb02dc2e5d806
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-10-09 13:42:59 +00:00
Mathieu Duckerts-Antoine 64293fbdb0 [FIX] web: prevent browsers inputs autofill
We don't want the browser to fill inputs in the backend.
Most of the time this is useless but sometimes it is
even problematic. For example, focusing an input in a
modal can trigger autofill not only in the modal but
also in the whole page. If there is an input outside
the modal and it is recognized by the browser as a
candidate to fill, bad things occur.

For that reason, we set the attribute autocomplete to
"none" by default for input elements.
Note that "off" does not work all the time because
the browsers sometimes decide to ignore it.

Task ID: 2076730

closes odoo/odoo#38039

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-10-07 08:40:53 +00:00
Christophe Simonis d74b451805 [MERGE] forward port branch 13.0 up to f4105eb9c7 2019-10-09 02:08:17 +02:00
Aurélien Warnon aeda568fe8 [IMP] web: add test case to the kanban records_draggable option
This commit adds a test case for the recently introduced 'records_draggable' option in the kanban
view.

Initial test was not written because of social app rush before 13.0 release.

'records_draggable' feature introduced by 869a5b83a5

Task#2082068

closes odoo/odoo#38166

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-10-08 09:07:37 +00:00
fw-bot f22ccb624c [FIX] web: calendar first day of week from res.lang domain
The feature that allows res.lang's first day of week parameter
to be the reference point of web calendar
has been introduced at 27b30daea5
A few other came on top of it to fix a few things

Before this current commit though, only Fullcalendar was
rendered using that initial value, nothing was done
to actually fetch the right data

After this current commit, we fetch data from the server
according to the range displayed by the calendar

OPW 2072872

closes odoo/odoo#38131

X-original-commit: 0bd82ef6489f3ea1da26fb6ee337b15e3f13d4e5
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-10-08 09:52:06 +00:00
Mathieu Duckerts-Antoine b919d438c7 [FIX] web: repair keyboard navigation in filter menu
Before this commit, invisible filters were rendered by
QWeb but hidden in the filter menu. This used to break
the keyboard navigation in the filter menu.
Now we don't render at all those filters since they were
completely useless anyway. This fixes the original
problem.

Task ID: 2057012

closes odoo/odoo#37567

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-10-01 08:32:14 +00:00
fw-bot f248684c50 [FIX] web: Reset correctly the selection on reference fields
Backport of 64f6e50d0c, with a test!

Closes #27109

Purpose
=======

If the model on a reference fields is not modified from the interface
by the user but by the server, the selection is not correctly
recomputed on the interface.

Specification
=============

By calling super first on the '_reset' method, the new model
is taken into account when resetting the selection.

closes odoo/odoo#38109

X-original-commit: b5b992d9c4e85c224ded795ff9ce14d1608b3ed6
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-10-07 14:52:38 +00:00
Julien Mougenot da2b247146 [FIX] web: m2o updates its value after reload
Changes the behaviour of many2ones when their value is changed via a form dialog.

Before this commit, when editing a m2o with a form dialog opened by an external button,
the field triggered an onchange with its old value before reloading its widget.
This caused the edition in list views to display outdated information when
saving multiple records.

Now, the reload is executed first, then the onchange occurs so that the value is
the newly updated one.

Part of task 2078807

closes odoo/odoo#37576

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-10-07 11:22:04 +00:00
Julien Mougenot 652414ca4e [FIX] web: grouped list multi edit with m2m
Before this commit, m2m fields were not updated when multi editing
in a grouped list.

Now, the fields are updated no matter how many levels of groupBys
are applied to the list.

Part of task 2078807

closes odoo/odoo#37589

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-09-30 12:53:18 +00:00
Vincent Schippefilt e06117bd85 [FIX] web: multi-hell-ditable list
only activate multi-edit on list with specific attribute.
When the attribute multi_edit="1" is set on the tree view the user
can select a/some records and it will activate the multi-edit
with confirmation dialog (even for a single record).
Also, on-change are not applied when using multi-edit

closes odoo/odoo#37525

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-09-30 08:57:23 +00:00
Aaron Bohy 48b76921be [FIX] web: display action title in breadcrumb
Create a simple subclass of AbstractAction (a client action), with
property hasControlPanel set to true. By default, the name of the
action should be displayed in the breadcrumb. Before this rev.,
it wasn't the case, as it displayed 'Unnamed' instead.

Bug spotted when doing an exercice for the JS smartclass.

closes odoo/odoo#37465

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-09-25 20:00:16 +00:00
5d82725f62 [FIX] web: stop defaulting on empty kanbans when you should not
1/ Write a form view with a o2m field that has its own inline tree view
(no other view exist in db for the target model)
2/ Open that view in a mobile environment
3/ Instead of having a list view, you get a kanban view. No luck for
you, since the default kanban generated by `models.py` is an empty one,
your records are *invisible* \o/

From what I can tell, the previous condition made no sense:
```
if (there is a list view and a kanban view)  <-- this seems absurd
  then (use the list mode)
elif (there is no list view but a kanban view)
 then (use the kanban mode)
else (use both modes)
```

The first condition seems absurd: it *actively* ignores a kanban view
if there is one. Even better, the list view whose existence it checks
is never there: it checks for a `tree` when it should be checking for a
`list`. In short, the first condition was *never* met, and you ended up
either with exclusive kanban mode or with both modes - even if you had
no existing kanban view for the target model...

This commit moves the normalization of `tree` into `list` before
attempting to process the x2many field's subviews. It clarify the usage
of `tree` vs `list` (cf. only use `list`) which  prevents weird edge
cases like described above.

closes odoo/odoo#36237

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Co-authored-by: Adrien Dieudonné <adr@odoo.com>
Co-authored-by: Pierre Paridans <app@odoo.com>
2019-09-25 12:50:59 +00:00
Christophe Simonis f1c0b08504 [MERGE] forward port branch saas-12.4 up to bef26222b8 2019-09-25 16:53:26 +02:00
Christophe Simonis 257a382b5c [MERGE] forward port branch saas-12.3 up to dd627b9698 2019-09-25 13:43:26 +02:00
Julien Mougenot 3147e5fada [IMP] web,*: editable readonly list views
*:board,hr_skills

Hold on tight, this is a tricky one.

Allows *any* readonly list view (only plain lists, not x2manies) to
become partially editable when checking records.

This means that once checked, a record line acts just like it was
in an editable list. You can click on it, edit any of its values as long as
they're not constrained by readonly modifiers, and save them on the fly.

Clicking on an unchecked record will have the same effect as before:
it will open the record, regardless of the other selected records.

You can also check multiple records and edit them all at once by
changing the value of one selected record (just like standard multi edition).

Keyboard navigation is also allowed between selected records (TAB and SHIFT+TAB
to navigate and ENTER to save).

/!\ If a list is only made of records having all of their fields locked by
readonly modifiers, checking a record and clicking on it will do absolutely
nothing. This is to keep consistency with the rest of the specs.

Task 1967602
2019-09-25 07:20:36 +00:00
Julien Mougenot f328b9ca8c [IMP] web: list multi edition confirmation modal
Changed the information dipslayed by the confirmation modal in multi edition
in list views.

Before this commit, the modal simply showed a one-line message with the amount of valid records.

Now, there are 3 elements:
- If all of the fields cannot be changed, a first line warns the amount of valid records.
- A second (or first if all fields can be updated) line ensuring that the user is aware of
the occuring changes.
- A table displaying the affected field and the updated value (readonly widget with the new value).

Part of task 1967602
2019-09-25 07:20:36 +00:00
Julien MougenotandAaron Bohy 0ebacff465 [FIX] web: list: prevent tables from overflowing
In an editable list, select a very long value in a many2one...

Before this commit, the table stretched as much as it needed to to
display all of the columns content.

Now, the largest columns are trimmed in order to keep the table
as wide as the list container (meaning it won't overflow anymore
unless there is a huge load of columns).

Also ensured that values trimmed by this feature are followed
by an ellipsis.

Task 2068261

Co-authored-by: Aaron Bohy <aab@odoo.com>
2019-09-25 06:16:54 +00:00
Julien Mougenot d99e80f92a [FIX] web: column resize trying to freeze the list
Before this commit, resizing a column would cause the
list to develop a mind of its own and to grow/shrink random
columns according to its own will.

Now, resizing a column does not "freeze" the list anymore and simply
gives a static width to the resized column.
2019-09-25 06:16:54 +00:00
Aaron Bohy be222b795e [FIX] web: list: keep widths when editing records
Let's assume an editable list view with at least two rows. Before
this rev., the column widths were re-computed and frozen each time
a record was switched into 'edit' mode. As a consequence, if the
user clicked on a row, and then on another one, column widths might
slightly change.

Task 2068261
2019-09-25 06:16:54 +00:00
Aaron Bohy 22d43f1540 [FIX] web: list: increase width of boolean columns
Task 2068261
2019-09-25 06:16:53 +00:00
Aaron Bohy 7e72471552 [FIX] web: correctly handle 'oe_read|edit_only' in lists
ClassNames 'oe_read_only' (resp. 'oe_edit_only') can be used in
x2many lists to hide columns in 'edit' (resp. 'readonly') modes.

However, before this rev., there were two issues:
 1) Having such a className on a <button> tag didn't work well as
    the 'display: none' rule didn't apply on the body cell (it only
    applied on the button). Same could be observed on <widget>
    nodes.
 2) Having more than one invisible column (with those classNames)
    didn't work either, because the footer cells weren't hidden.
    We didn't notice it with one invisible column, because the
    footer contained one cell less than the header and the body.

Those two issues could be observed on the mrp.bom form view.

Task 2068261
2019-09-25 06:16:53 +00:00
a7a60f7c61 [FIX] web: avoid multiple displays of the "same" discard warning
Before this commit, editing a record e.g. in a form
view and toggling the home menu would cause the discard
warning to be displayed twice when going to the home
menu (in enterprise) and then once again when going to
an other app. This is now fixed.

Task ID: 2043027

closes odoo/odoo#37301

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
Co-authored-by: aab-odoo <aab@odoo.com>
2019-09-24 08:34:43 +00:00
Christophe Simonis ac4fc6e7c7 [MERGE] forward port branch saas-12.3 up to bd3e510edb
closes odoo/odoo#37314

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-24 09:44:56 +00:00
Martin Trigaux 2471ee506f [FIX] web: translate html fields
This commit fixes:
- body of a email.template in a small field
- translation of website_description of a product does not show the
  source of the translation
- translation of website_description of a product shows the full
  content for the current language

HTML fields are typically fields with longer of content.
If the field is an HTML field, it should be displayed in a textarea,
like the text fields.

Most of HTML fields are split in meaningful chunks of content (using
xml_translate or html_translate method).
For these fields, the source must be displayed.

Also sort the entries on the source to have a consistent order

closes odoo/odoo#37215

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-09-24 15:52:55 +00:00
Christophe Simonis d67b2483e5 [MERGE] forward port branch saas-12.4 up to 9ed4872ea0
closes odoo/odoo#37372

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-24 17:45:37 +00:00
Andrea Grazioso (agr-odoo) 3ee3f7d497 [FIX] web: digits option not applied in list view
From the settings activate:

- Multiple Sales Prices per Product
-- Prices computed from formulas
- Discounts

Create a pricelist with discount policy "Show public price & discount to
the customer", set the price calculation formula:
- Rounding: 10
- Price discount: 10%

Modify the sale order xml list view adding 'digits="[3, 2]"' to the
discount shown in the sale order line.

Create a sale order with such pricelist and on the so line put a
product with quantity 1 and sale price 4190 (VAT 19% included in the price).

The discount will not display the requested number of decimal digits (2)
in list view, but it will when editing the field.

The cell formatting is done calling the appropriate function (formatFloat),
which search the digits option from the 'options' parameter or from the field
definition. The latter stores the default digits coming from
the DecimalAccuracy settings, which, as side effect, alter the behavior
of the discount calculation.
https://www.odoo.com/web#view_type=form&model=project.task&id=2069939&active_id=2069939

When passing into edit mode the field is created as widget, parsing its options
which have 'digits', instead when coming back in list mode it is "just a
float field" rendered directly from the list_renderer which no options,
so the formatFloat will look at the field definition
https://github.com/odoo/odoo/blob/12.0/addons/web/static/src/js/fields/field_utils.js#L172

Adding the correct parameter to the dictionary passed to formatFloat
during the list rendering is a possible solution, because it is the
"closest" point in which parsing the parameter is possible without
touching higher level code or forcing the creation of a widget (adding
widget='float' as xml parameter).

closes odoo/odoo#37167

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-09-20 05:37:56 +00:00
Jorge Pinna Puissant f629cd9672 [FIX] web: write date without separator
Since fbbfa6d it's not longer possible
to write a date without separator (e.g., 0102 for 01/02/2019; 121298 for
12/12/1998;  02042018 for 02/04/2018), or a date without year (e.g.,
01/02 for 01/02/2019) in the datepicker widget.

In this commit we have decided to be as permissive as tempus dominus
that call moment.js with strict false. This allows moment.js to deduct a
date from a string in a more versatile way. This also allows a more
versatile autocomplete in the search views.

opw-2070464
opw-2070931

closes odoo/odoo#37095

Forward-port-of: odoo/odoo#36821
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-09-19 07:07:03 +00:00
Julien Mougenot 31ec900bb0 [FIX] web: list selectors synchronisation
Changed the way the header selector behave when the selection changes.

Before this commit, the header selector was only checked when clicked and
was unchecked as soon as any other record was unchecked.

Now, the header selector reflects the current visible selection:
if all of the other visible selectors are checked, it will be checked.

Folded records are not considered visible, thus only records from active groups
and from the current pager will be taken into account.

closes odoo/odoo#36522

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-09-18 08:24:32 +00:00
Julien Mougenot ca4e158a8e [FIX] web: handling of invalid formats in list views
Added handling of invalid format types in multiple edition in list views.

Before this commit, in multiple edition, a field that was edited with an invalid value format
(e.g. a numeric field receiving a string value) didn't trigger a field_changed and no prompt
was shown; the record was simply idle with an dirty value.

Now, the list controller also listents for set_dirty events and automatically triggers
an error modal + discards all changes when receiving one.
2019-09-18 08:24:32 +00:00
Julien Mougenot d261d42d9b [FIX] web: list: m2o doesn't trigger fieldChange when empty
Gives time to the user to enter an actual value in m2o in list views.

Before this commit, emptying a many2one field (selecting all > BACKSPACE or DELETE)
triggered instantly a field_change. This was an issue in multi edition as a field
changed triggered instantly a save on selected records without giving time to the
user to enter a new value.

Now, many2ones only trigger a fieldChange when selecting a new valid value.
2019-09-18 08:24:28 +00:00
Aaron Bohy 3b4cc84c1c [FIX] web: list: multi edition: disable onchanges
Onchanges make no sense in multi edition as they would be computed
on the 'reference' record (the one use to edit), but applied on all
selected records. This rev. simply disables them in that case.

Task 2068280
2019-09-18 08:24:13 +00:00
Julien Mougenot a7782cadbe [FIX] web: lists: focus last edited cell
Gave back focus to the last edited cell to increase usability with key nav.

Before this commit, after saving several records with multi edition in a list,
focus was lost (given to the body).

Now, last edited cell is given back the focus after multi editing.
2019-09-18 08:24:13 +00:00
Aaron Bohy af65475a4c [FIX] web: list: multi edit input of date(time) fields
The Date(Time)Fields listen to 'input' and 'change' events (like
all InputFields) to keep track of changes. However, the datepicker
already listens to the 'change' event. As a consequence, in multi
edition in a list view, if the user changed the value of a
date(time) field by directly editing the input, the fieldChanged
event was triggered twice, and there were 2 dialogs asking the user
if he wanted to save the change.

This rev. makes the Date(Time)Fields stop listening themselves to
'input' and 'change' events, and instead completely rely on the
datepicker widget.

Task 2068280
2019-09-18 08:24:13 +00:00
Aaron Bohy ac85176ce8 [FIX] web: date(time) fields: trigger fieldChanged once
Before this rev., the 'fieldChanged' event was triggered each time
the user selected a value (a day, an hour, a minute or a second) in
the datepicker. This means that if there was an onchange on the
field, a lot of RPCs could have been done when a user set a
datetime. In addition, in a list view with multi edition, the user
was asked to save the changes at each step of the datetime
selection, making the feature unusable.

Task 2068280
2019-09-18 08:24:13 +00:00