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.
closesodoo/odoo#36278
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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
closesodoo/odoo#35092
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
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.
closesodoo/odoo#35306
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
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.
closesodoo/odoo#36176
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
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
closesodoo/odoo#34752
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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.
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
closesodoo/odoo#35975
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Gery Debongnie <ged@odoo.com>
*: 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.
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.
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.
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.
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.
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.
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').
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.
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>
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 #2057230closesodoo/odoo#35890
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
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
closesodoo/odoo#35603
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
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.
closesodoo/odoo#35495
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
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.
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
closesodoo/odoo#35098
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
After editing multiple record, we want don't want any
record selected. This commit ensures that.
closesodoo/odoo#35678
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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
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
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.
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.
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.
closesodoo/odoo#34051
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
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.
closesodoo/odoo#35340
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
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.
closesodoo/odoo#34902
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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.
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
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
* 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
closesodoo/odoo#32339
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>