Commit Graph
1596 Commits
Author SHA1 Message Date
Pierre Paridans 81d0f39480 [FIX] web, base: MockServer should have the same behavior as the server
An RPC call using an empty array of fields has not the same behavior on
the MockServer and the actual server:

- the MockServer returns only the 'id' field
- the actual server returns all the fields for the model

This is due to the fact that an empty array evaluates to a falsy value
in Python and evaluates to a thruthy value in JavaScript.

This commit restores the parity between the two.

closes odoo/odoo#36278

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-08-30 09:09:48 +00:00
Priyanka KakadiyaandMohammed Shekha 135079044c [IMP] web: removed autocomplete filters and groupbys
purpose of this commit is:
- to remove filter and groupby option which are added at the time of fuzzy
search, it was useless as we have separate groupby and filter menu
also it generates the big dropdown menu so it is more confusing.
- align caret icon with the label.

After this commit:
- when user do the fuzzy search then filter and groupby option will not be shown
in the dropdown

task-2036351

closes odoo/odoo#35092

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>


Co-authored-by: Mohammed Shekha <msh@odoo.com>
2019-08-30 05:06:47 +00:00
jbm-odoo 58cf9b6754 [FIX] base: Open One2many with not yet updated values
When we have an onchange that modify items in One2many's lines (for
example the quantity of each line based on general quantity) and
we click on a record immediately after changing the field that
trigger the onchange, we have the the old value in the dialog box.
Indeed the dialog opens before the onchange has return the new
values, so the old one are used. This case appears only if the
One2many's line was never saved.

With this fix, we wait that the model is free of mutex, and so the
onchange is terminated before displaying it.

closes odoo/odoo#35306

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-08-28 13:51:40 +00:00
Aaron Bohy 711a10162a [FIX] web: enter edition editable list with <widget>
Let's assume an editable list view with a <widget> node in its
arch. Before this rev., when clicking on a field cell positionned
*after* the widget, the field next to the clicked one was focused.

closes odoo/odoo#36176

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-08-28 11:24:48 +00:00
Priyanka Kakadiya 5f35819fff [IMP] web: remove 'ID' field from custom groupby dropdown
purpose of this commit is to remove ID from the fields to group by on the
searchview as it does not work nor does it make sense.

removed field 'ID' from custom group by on search view.

task-2028105

closes odoo/odoo#34752

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-08-28 08:43:03 +00:00
Mohammed Shekha 6952ee18bc [FIX] web: crashmanager wrong syntax of arrow function
arrow function used for error handler and error function is defined
inside inner function so this will get changed, need to use self,
also arrow function doesn't have its own arguments object,
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions

Issue raised from following commit:
https://github.com/odoo/odoo/commit/2d6dc75a2cb5fa81189920d0f7fdc7b7f12132ab

task-2052484

closes odoo/odoo#35788

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-08-27 12:13:43 +00:00
Pierre Paridans 96a52daa80 [REF] web: remove test coverage overlap in mobile test suite
The tests in the file `relational_fields_mobile_tests.js` - which is
part of the mobile test suite - are actually not specific to mobile.

This commit merges those tests asserts into the tests already present in
the regular test suite. It ensures that all the existing asserts remains
and the actual coverage stays the same.
2019-08-26 14:13:06 +00:00
Julien MougenotandGery Debongnie 7812aec9c1 [IMP] web: editable list view resize
Added a resizing feature to all non-empty editable lists:
- added a handle to each column header, allowing resize
- column width will expand/shrink the table width
- resized columns will reset when reloading the list or sorting columns
- only available when the list contains data

closes odoo/odoo#35975

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>


Co-authored-by: Gery Debongnie <ged@odoo.com>
2019-08-26 07:49:28 +00:00
Julien Mougenot 38910befdf [REF] web: add style tests for list view
Added tests for:
- monetary field in 'fixed width' test
- height and width consistency between edit/redonly
- textareas word-breaking on long words
2019-08-26 07:36:28 +00:00
Julien Mougenot 91ea5a2ca4 [REF] web,*: native event dispatching in test utils
*: mail,partner_autocomplete: adapted tests

Added a new function to trigger the adequate type of event on
an element (native JS event to DOM Nodes and jQuery event to jQuery objects),
and refactored the generic event-triggering functions to call this new function.
2019-08-26 07:36:28 +00:00
Aaron Bohy 85bfef9ced [FIX] web: editable list: widths when toggling fields
Let's assume the following situation:
 - an empty editable x2many list with date field (or any other
   fixed width field) and optional fields
 - add a record to the list, but discard it directly
 - toggle an optional field

After those steps, the date field doesn't have its hardcoded,
absolute width anymore.

This rev. fixes this issue by clarifying the way the stored widths
are erased when the columns change, preventing to reach a corner
case in which we have stored widths, but we can't apply them, and
thus let the browser uniformly divide the space amongst columns.
2019-08-23 06:28:35 +00:00
Aaron Bohy e35c5e044e [FIX] web: editable list: force min-width to some columns
Columns with an absolute width (e.g. '120px') must always have a
width of at least that value. When there are records in the list
the column's widths are computed by the browser according to the
content (in readonly). However, for some field types, the rendering
in edition is a bit wider (e.g. date(time) fields because of the
caret).

This rev. sets a min-width to those fields such that the rendering
is also correct in edition.
2019-08-23 06:28:35 +00:00
Aaron Bohy f00f7bf00d [FIX] web: grouped list: correctly compute col widths
Before this rev., a grouped list view with all groups folded
behaved like a list with records w.r.t. the computation of column
widths, whereas it should behave like an empty list, as there is
no record to help the browser to compute the optimal width for each
record.
2019-08-23 06:28:35 +00:00
Aaron Bohy dddaff8418 [IMP] web: list: keep widths when removing last record
When there were records in the list (and the browser computed the
optimal column widths according to them), and the user removes
them, we want to keep the widths as they are instead of forcing
them according to the field's types.
2019-08-23 06:28:35 +00:00
Aaron Bohy 1824020cc2 [IMP] web: list: keep columns width when adding records
Mainly, when adding the first record to the list, as this is when
we switch from forcing the column's widths (when there is no data),
to letting the browser optimally divide the available space.

Some other cases had to be handled, like the multi edition.
2019-08-23 06:28:35 +00:00
Aaron Bohy 4393b012a5 [REF] *,web: list: merge width and width_factor attrs
Having two attributes for this was probably overkill. We now have
a single attribute 'width' which can specify either a fixed width
(e.g. '120px') or a factor (e.g. '2.5').
2019-08-23 06:28:34 +00:00
Aaron Bohy b2c09b4d3d [FIX] web: list: determine width according to widget
On a list with no data, the width of each column is determined by
a heuristic. Before this rev., the heuristic was based on the field
type. It now takes the potential widget set in the arch into
account, and fallbacks on the field type.
2019-08-23 06:28:34 +00:00
Géry DebongnieandAaron Bohy bf3c1d3e0c [IMP] web: editable list: column's widths
This rev. refines the way we compute column's widths in editable
list views.

When there are displayed records, we let the browser compute the
width of each column (which is thus optimal with respect to the
content), and we then freeze those widths s.t. it doesn't flicker
when we switch a row in edition.

When there is no record, we keep the former heuristic based on
absolute and relative widths (depending on field types). However,
we set the same weight for all fields having a relative width (i.e.
all but boolean, date(time) and numeric), such that the remaining
space is evenly distributed between them.

Co-authored-by: Aaron Bohy <aab@odoo.com>
2019-08-23 06:28:34 +00:00
Jigar Patel 4a771a6763 [FIX] web: use correct avatar field for many2many_tags_avatar field widget
The issue has occurred after rename image fields https://github.com/odoo/odoo/commit/58a2ffa26f1a3b0f9630ce16d11b758d18e20a21

closes odoo/odoo#35596

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-08-09 11:21:09 +00:00
Géry Debongnie f926318a78 [IMP] web: keep dirty fields dirty
Before this commit, a simple optimization was done: if a field was
modified in such a way that the new value is the same as the initial
value, then it is not considered changed.

However, with the new changes in the ORM, it may be an issue, because
doing so loses the intent of the user.  If an onchange changes a field,
then the user changes it back, the server is not aware of that fact.

With this commit, we simply keep the field in the list of changes to
send to the server.

opw #2057230

closes odoo/odoo#35890

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-08-21 08:27:42 +00:00
Christophe Simonis 3faea8fbf8 [MERGE] forward port branch saas-12.4 up to f26de445e5 2019-08-21 10:10:11 +02:00
Christophe Simonis f26de445e5 [MERGE] forward port branch saas-12.3 up to 6f55fd65da 2019-08-20 12:17:04 +02:00
Christophe Simonis 168e54d488 [MERGE] forward port branch 12.0 up to 32039b2ab4 2019-08-19 18:57:08 +02:00
Aaron Bohy cf318ad90c [FIX] web: list: tweak columns weight 2019-08-16 06:37:07 +00:00
Christophe Simonis f58f5e8b1f [FIX] web: adapt test to new version
Oversight of previous forward-port.
2019-08-13 10:55:43 +02:00
Christophe Simonis b2872e9bab [MERGE] forward port branch saas-12.3 up to 499d3efa7c 2019-08-13 10:08:12 +02:00
Jinal PatelandMohammed Shekha f0fdfbf44e [FIX] web: add support for TRUE_LEAF and FALSE_LEAF in ModelFieldSelector
before this commit, domain selector widget does not support
TRUE_LEAF and FALSE_LEAF i.e. [(1, '=', 1)] and [(0, '=', 1)] respectively,
the reason is the chain part of the domain i.e. field name has value 1/0 and
we don't have field name like 1 and 0 in domain and hence ModelFieldSelector
don't accept it

after this commit, domain selector can handle this special two domains which is
[(1, '=', 1)] and [(0, '=', 1)], add support for chain with 1/0 in ModelFieldSelector

task- 1998145

closes odoo/odoo#35603

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>


Co-authored-by: Mohammed Shekha <msh@odoo.com>
2019-08-09 12:32:27 +00:00
Christophe Simonis b792ba7d9a [MERGE] forward port branch saas-12.3 up to 752b2553c6 2019-08-08 11:52:13 +02:00
Mathieu Duckerts-Antoine ba4ce71bf5 [FIX] web: favorites have unique descriptions
In the favorites menu, it was possible to create two
favorites with the same name (contrarily to the
specifications). The root cause of the problem was that
the submenus of the favorites menu were not updated at
all. This commit fixes that situation.

closes odoo/odoo#35495

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-08-07 15:24:06 +00:00
Mathieu Duckerts-Antoine 691a8a690c [FIX] web: toggle favorite correctly updates other filters status
When toggling a favorite filter, the options used by
the active date filters/groupbys and the field created
via autocompletion were not correctly cleared, leading
to strange situations. This is fixed by this commit.
2019-08-07 15:10:57 +00:00
Christophe Simonis 7d04dc1c7c [MERGE] forward port branch saas-12.2 up to 9e74730a26 2019-08-06 18:48:24 +02:00
Julien Castiaux e26a5e46ff [FIX] web: spam new event creates multiple modals
On the Time Off, spam click to create a new event, each click opens a
new event form modal.

When the modal form fields have not been cached yet, the frontend
fetches them and delay the modal form opening after those fields have
been fetched. As the interface is still available. It is possible to
re-click multiple time during the fetch, each click schedules a new
modal form. When the first finally shows, they all stack on screen.

opw-203577

closes odoo/odoo#35098

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-08-02 11:42:27 +00:00
Julien Mougenot 955856abf4 [FIX] web: no selected records after multi edition
After editing multiple record, we want don't want any
record selected. This commit ensures that.

closes odoo/odoo#35678

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-08-16 09:03:49 +00:00
Julien Mougenot dd27b2e9c6 [FIX] web: multi edition in editable listviews error handling
Fixed crashes/incorrect behaviours in multi edition in the list views.
The solution to these problems was mainly to refactor the function
used to save multiple records.

Before this commit:
- Cancelling the confirmation dialog in multi edition caused
the edited record to be editable but disabled
- Saving an empty field in multi edition triggered a JS error
- Static confirmation message ("saving 0 valid records")

After this commit:
- Ability to cancel confirmation
- Proper error display when trying to save empty fields
- Message consistent with the situation
2019-08-16 09:03:49 +00:00
Julien Mougenot 291dad6bc8 [FIX] web: fixed crash in editable grouped lists
Adding a line in grouped listviews caused a crash in some cases.

Steps to reproduce:
- go in any grouped editable list view
- click on any "Add a line" cell, but not on the link itself
- press ENTER

Before this commit:
A crash occured. Unable to add a new line. Needed to refresh the page.

After this commit:
Line addition functionnality properly working even when selecting the outer cell
2019-08-16 09:03:49 +00:00
Julien Mougenot b416c15a77 [IMP] web: dialog triggers custom callback on close
Added an option in the Dialog class to give it a function to run
when it's closed by other ways than by its buttons.
Its default value is the "cancel" callback if given, or none.

Before this commit, there was no way to add any callback to run
when the modal wasn't closed by a button.

Now, when exiting the modal by other means (e.g.: "Escape" key),
it will run a given callback.
2019-08-16 09:03:49 +00:00
Julien Mougenot bec84c10a1 [IMP] web: keyboard navigation between searchbar and renderer
This change allows direct keyboard navigation between the current action
searchbar and renderer.

Focus can now be toggled using DOWN arrow when focusing the searchbar
or the UP arrow when focusing the top cell/record of a kanban or a list.
2019-08-16 09:03:49 +00:00
Christophe Simonis 7fea618b25 [FIX] web: correct test
Oversight of previous forward-port.
2019-08-14 17:42:38 +02:00
Christophe Simonis 140ee6b8f0 [MERGE] forward port branch saas-12.4 up to 98a55917a6 2019-08-14 16:48:10 +02:00
David Monjoie 307db30067 [FIX] web: add view id in optional fields local storage key
Since the renderer does not know the view id, we moved the local
storage key computation up to the basic controller, which makes
more sense since the renderer is supposed to be inert.

The _processColumns function had to be moved in willStart however,
since it now needs the controller to respond to the trigger_up
and the controller is not present during the init of the renderer.

closes odoo/odoo#34051

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-07-30 06:37:23 +00:00
David Monjoie 321a3699ed [FIX] web: fix mock_server tree_view_ref support 2019-07-30 06:37:22 +00:00
Mathieu Duckerts-Antoine 1631c9dbc9 [FIX] web: date filter options unselected after facet deletion
Select the option 'This Month' of a date filter
in the filter menu and then remove the facet created
correctly toggles the filter from the query but the
option is still shown as selected. This commit fixes
that situation.

closes odoo/odoo#35340

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-07-31 12:35:48 +00:00
fja-odoo 20efea970a [IMP] *: display some onchange warning with notif
* = base, web, sale, stock, sale_stock, stock_account

Warnings for the onchange now takes a type to know if it needs to be
displayed with a notification. Else it is displayed with a dialog
notification (like before).

Related to https://github.com/odoo/odoo/pull/32132 and
https://github.com/odoo/odoo/pull/35209

Part of https://github.com/odoo/odoo/pull/35342

task-2047628

closes odoo/odoo#35342

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-08-09 15:47:09 +00:00
fja-odoo 9c3fe4aae2 [IMP] web: keep toast open when hovered
Previously non sticky toast were automaticaly closed after a delay.
Now while a toast is hovered it will stay open and when the cursor
leaves the toast, the delay is reset.

Related to https://github.com/odoo/odoo/pull/32132 and
https://github.com/odoo/odoo/pull/35209

Part of https://github.com/odoo/odoo/pull/35342

task-2047628
2019-08-09 14:17:30 +00:00
Mathieu Duckerts-Antoine 52181a2219 [FIX] web: favorites have unique descriptions
In the favorites menu, it was possible to create two
favorites with the same name (contrarily to the
specifications). The root cause of the problem was that
the submenus of the favorites menu were not updated at
all. This commit fixes that situation.

closes odoo/odoo#34902

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-08-13 08:18:16 +00:00
Mathieu Duckerts-Antoine 397e00f181 [FIX] web: toggle favorite correctly updates other filters status
When toggling a favorite filter, the options used by
the active date filters/groupbys and the field created
via autocompletion were not correctly cleared, leading
to strange situations. This is fixed by this commit.
2019-08-13 08:18:16 +00:00
Mathieu Duckerts-Antoine d561868bfa [IMP] web: review date filters and groupbys functioning
This commit modifies the functioning of date filters
in the control panel Filters and Group By submenus.

For a filter with date attribute set, the list of
proposed options is shorter but allows a bigger set of
domains to be quickly created (through combinations of the options).
The resulting list of domains is different of the previous one:
domains like "Today" or "Last Week" are left aside but many others
(and their unions) are now accessible.
The domains generated in that way are no more dynamic but it is still possible
to save dynamic filters in general.

This commit also reintroduces the multi selection of options for groupbys of type
date/datetime in the groupby menu.

Task ID: 2028787
2019-08-13 08:18:06 +00:00
Alexandre Kühn 7d8977182b [IMP] web:tests: patch Date.now
Before this commit, when we use `testUtils.patchDate`,
the function `Date.now` was not using the fake date for reference.

This is an issue with the lib momentjs, which instantiate the
current date as follow:

```
new Date(Date.now())
```

Because of this, we were handling patched date and unpatched moment
objects.

Task-ID 1902848
2019-08-13 07:57:10 +00:00
Thanh Dodeur fa927315e5 [IMP] web: adds multi file drag and drop support
This commit adds a function to mock multi-file drops.

Task: #2002553

closes odoo/odoo#35435

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-08-08 07:26:44 +00:00
Kishan Gajjar 22b598bc1b [IMP] web: export improvements
* remove center buttons, corresponding features either moved to fields
list (handle / bin on exported, etc...) or removed
entirely (e.g. clear)
* replace XLS to XLSX format, increases rows# to 1048579
* add FAYT filtering of available fields
* sort available fields alphabetically (CI) always
* change export templates UI: remove buttons

TaskID: 1910953

closes odoo/odoo#32339

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-08-12 13:38:31 +00:00