Menu items for measures list are now sorted by their 'string' value.
We set that string in lowercase because uppercase/lowercase influences
string comparison, so we are sure to compare always strings with the
same case.
This fix is effective for pivot view, cohord view and graph board.
Task #1882576
With this commit, we limit the kanban view to 10 open groups
at the start. This is useful to prevent the web client to make
too many requests at once.
This limit is set in the constant 'OPEN_GROUP_LIMIT'.
Note:
- columns already set as folded by default aren't take into account.
- the user can still open any folded column, as usual.
Task #1878113 (1/2)
Before this commit, when we click on the 1st control in
an editable list (usually 'Add an item') then press ESCAPE,
the focus was not on the 1st control.
The intended behaviour is to have the focus on the 1st control,
so that we may navigate left/right between controls solely with
the keyboard.
With this commit, when a cancel keyboard navigation event is
triggered in an editable list, it auto-sets the focus on the
first control.
Co-authored-by: Alexandre Kühn <aku@odoo.com>
This commit fixes a few issues with the previous implementation of the
automatic addition of new lines in x2many inside forms
1. Before this commit, when there is a change of mode in a formview
`edit` -> `readonly` -> `edit`, there may be some cases that
mistakenly and automatically opens a modal.
This case occurs in a form view with a x2many field whose 1st inner
focusable element opens a modal (e.g. "Add an item").
In `edit` mode:
1. Open this modal from the x2many
2. Close the modal
3. Change mode to `readonly`
4. Change mode to `edit`
> the same modal is automatically open.
This is due to the tracking of the last activated field that persists
after a change of mode. Since the last activated field in the 1st
`edit` is the x2many, it is granted the focus at the beginning of the
2nd `edit`, which automatically opens the modal.
This commit fixes the issue by resetting the tracking of the last
activated field when there is a change of mode. As a result, at the
beginning of the 2nd `edit`, the focus should always be on the 1st
field.
2. Before this commit, if the focus was moved out of the form (to a modal
for instance) then back, the form would re-activate the last field, which
is the x2many and would re-add a new line. This behavior is not correct
and now going back from a modal to a form does not add a new line.
Co-authored-by: Alexandre Kühn <aku@odoo.com>
Before this change, when the focus was on the first field on a x2many
field, and the user pressed TAB, the line would be discarded and the
focus moved to the next field (at the level of the x2many) in the form.
This was an issue because if the first field was required, the focus
could not be moved out of the field with TAB so the user had to discard
the line manually (with ESC) before moving to the next field
This change works with 2 changes:
1. detecting if a line is dirty (has been modified by the user) and at
the end of the line, decide to either
- discard the line and move the next field, if the line is not dirty
- commit the line and add a new line, if the line is dirty
2. allow users to use TAB through required field inside x2many so they
can easilly go to the end of the line.
Task id : 1872248
The idea for this change is that there are different behaviors when using
the keyboard inside an editable list:
when the focus is at the end of a text field, it moves the focus to the
right cell when pressing right, but not when the focus is in the middle
of the field. Also, moving up from within a multiline text field was incoherent.
In order to simplify the keyboard navigation, only TAB is used to move
from field to field inside and outside a editable list.
Task id : 1872248
Since odoo/enterprise@e3b0d2a, the title wasn't set anymore.
This logic is now moved in the graph renderer to be able to
set a title in every graphs.
For now, we only use the title attribute for pie charts embedded
in dashboard views.
Additional tests has been added in 'web_dashboard' (enterprise).
Currently kanban columns propose an Archive / Unarchive option if the
records model has an active field. It allows to directly archive or
restore all records belonging to that column. It is currently not possible
to control whether this option is present or not as it only depends on the
active field being defined on the model.
In some specific cases we want to be able to hide this option even if the
active field exists. For example future commits will hide this option for
leads (crm.lead) as business flow goes through marking them as won or lost
instead of archiving / restoring them.
This commit adds support of a new archivable parameter when defining the
kanban view that hides the archive buttons if it is set to False. Default
value is true so that current behavior is kept as it is by default.
Doc and tests are added.
This commit is linked to task ID 1880051 and PR #26977.
The datepicker lib has been updated to tempus dominus (BS4)
recently, but our code hasn't been adapted correctly to the
requirements of the new version of the lib. As a consequence,
the datepicker didn't close itself when the input was focused
out anymore.
This required a slight change in the DomainSelector widget as it
produced a crash when a focused datepicker widget is removed from
the DOM (before the datepicker is destroyed), e.g. by a call to
html() on one of its parent.
Task 1878254
This rev. is similar to db9b91ff, but treats the x2many case.
Calls to the 'commitChange' function of renderers must not be done
inside a mutex, mainly since 241704536, as they could end up in a
deadlock. For x2manys, it was actually the case in practice in
Inventory > Operations > Inventory Adjustments > Create > select
'One product only' > select a product > try to edit the real
quantity in the editable list > focusout > deadlock.
The reason why the deadlock occurred in this view and not in, e.g.
sale.order, is due to the presence of the field_float_scannable
widget. Indeed, the barcode engine intercepts input events and
manually re-triggers them. As a consequence, the 'change' event is
not triggered on the field, and it does not notify the environment
of its new value by itself, until the field x2many asks it to
commit its value. Note that this might be an issue as well, as
onchanges are thus not triggered.
Task 1878254
Rev. f241441 recently added the possibiliy to define custom
controls (instead of the single 'Add a line') in editable list
views. However, it didn't take into account keyboard navigation.
Suppose that the focus is on the field preceeding the list, and
the user clicks on TAB, the code assumed that there was only one
control, and focused it. However, when there were several control,
the last one was focused (which is typically the less common one),
and there was no way to navigate to the others.
This rev. focuses the first control by default, and allows to
navigate through controls with RIGHT and LEFT. Pressing TAB still
moves out of the list, to the next field.
Note that i'm not happy with this fix, as the logic doesn't seem
to be in the right place. Indeed, the notion of controls is the
concern of the editable list, not the x2many field, so the list
should handle this logic by itself. Unfortenately, this is not that
easy to change, as for now the list doesn't even know that we are
navigating to/from its control(s), until we click on it/them.
Changing that will be for later, in master.
We also did a linting pass on the concerned code.
Task 1878254
This commit fixes the handling of the service parameter
in a mocked environment:
- updated docstring: now an object (previously an array)
- no longer used by mocked server (unused parameter)
- enforces default value for this parameter (empty object)
The test was failing because it was using an old approach to mock
services in JS tests. Also, it provides ajax service in the list
of services, which was not supported in a mocked environment.
With this commit, when an ajax service is provided in the test,
it will use this service instead of using mocked RPCs from the
mocked server.
Hardening of commit:995610c065bf0242cb5023cfad2940234395739e
The JournalDashboardGraph requires nv, which is lazyloaded.
However it requires nvd3.js which is loaded after nv.d3.js.
A function called in destroy is defined by nv.d3.js,
which can make the crashhappen with the right (wrong) timing.
opw 1873749
The resequence mechanism works if the sequence is sorted by its handle field.
Therefore sorting on another field should lock the handle, while sorting on the
handle field should unlock the handle.
opw 1867049
- added two new actions to the form view debug action list,
both opens list (+ form) views of messages and attachments respectively
for which the domain is restricted to the current record.
task: 1860031
With this commit, we introduce a new 'fail fast' feature to our qunit
test suite: when it is activated, the qunit test suite will immediately
stop after the first failed test.
It is accessible as a flag in the url (failfast), or by clicking the
checkbox in the UI. It is currently not activated by default.
Note that this commit also change the url for the runbot phantomjs test
in order to activate this feature. This allows us to increase the global
timeout for the js test suite without fear!
Backport of 611c836a46
This reverts commit 4cb585ab4f.
When creating from the kanban view:
- crm.stage
- hr.recruitment.stage
- project.task.type
- helpdesk.type
- mrp.eco.stage
We go from a dashboard of eg. "GroupRecord" named "group_id" in the
record. And when a stage is created, "default_group_id" is used. With
the change the stage was not linked to the current "grouping".
We could probably use "search_default_group_id" instead but the behavior
may be present in existing customization.
opw-1884217
closes#26943
Due to the route beginning with 'test: ', it was interpreted like a
protocol and on some OS (ubuntu for example), a xdg-open prompt pops up.
So, the window looses focus and some tests will fail because of that.
Rev. db9b91ff removes a use of a mutex where it could end up in a
deadlock situation (and where the use of the mutex wasn't
necessary). However, it caused an issue as the following scenario
didn't work anymore:
- in a form view with a one2many with fields A and B (required),
with an onchange on A setting B,
- add a row and set a value for A,
- click on 'Save' directly (before the onchange RPC returns)
- whereas it should wait for the onchange to return before
trying to save, it tries to save directly but faces an unset
required field, and displays a warning to the user.
The reason is that, before saving, the FormController asks all its
widgets to commit their value (through a call to commitChange).
This call was, prior to db9b91ff, done in the mutex. The onchange
RPC being itself done in that mutex, we thus waited for the
onchange to return before calling commitChanges. After db9b91ff,
since there was no longer a mutex, commitChanges was called
directly, and the editable list returned a warning as one of its
required field was unset.
This commit ensures that commitChanges is called once all onchange
RPCs are done, by waiting the mutex to be idle.
Before this rev., if the user clicked on a tag to open the color
picker, and then clicked in the dropdown, but not on a color, the
color picker closed itself, and it was no longer possible to open
it again.
This issue came with the migration to BS4 and its following fixes.
As the color picker is now a classical BS dropdown, it closes
itself automatically, so we don't need to manually close it on
focusout.
Task 1878254.
Remove part in service_mixins who hide this error. Queries must be able
to be canceled for better performance. Also in the case of longpolling,
if the request is not canceled, wait for a server message or the maximum
time (30 sec) to add or delete channels.
When cliking on a calendar cell user is redirected to a form view to create
a new record. However if the calendar action gives a specific form view ID
it is not taken into account by calendar.
Calendar code still handles views as not being a structure holding viewID and
type but just an ordered list of items with (view ID, type). This commit fixes
that code. One calendar JS test is updated to correctly match the current
structure.
This commit is linked to task ID 1876795 and PR #26571.
This allow the browser/device to handle the experience of handling number in a more native way.
FieldInteger and FieldFloat now inherits from NumericField because we want
to format it or not dependent of the view (readonly or edit) and the
NumericField will manage it.
We do that because input type number can't take a value with comma on Chrome
(FireFox is more permissive but not perfect because comma is the separator
for decimal in this case).
Task #1880376
Up until now, the execution of a report action could not be followed by
any action which prevented, for example, to automaticcaly close a modal
after printing a report from it. This has become an issue when working
on customer's invoices using the new modal introduced in 4cb9194275
This commit allows to close a modal after the download of a report.
Before this rev., there was a crash when a FieldDomain was reset
with a new domain (e.g. coming from an onchange). For instance, it
crashed in Email Marketing > create new Mass Mailing > select
mailing lists. Introduced by 68332a01.
opw-1882850
Before this commit, the `dom.autoresize` function may apply the
padding and border width twice when computing the height of the
textarea. This issue occurs when the fixed textarea had the same
CSS style as the textarea.
This commit fixes the issue by enforcing zero padding and border
width in the fixed textarea.
Task-ID 1882736
The resequence mechanism works if the sequence is sorted by its handle field.
Therefore sorting on another field should lock the handle, while sorting on the
handle field should unlock the handle.
opw 1867049
Let's assume a quick create form view with an onchange. Before
this rev., if the user set a value for the char field with
onchange, then clicked on 'Add', the record was created before
the onchange was applied, and thus with incorrect/incomplete data.
The reason is that, when clicking on 'Add', the user triggers a
'change' event on the char field, which notifies the model of its
new value. Then, as 'Add' is clicked, the quick create widgets asks
all widgets to commit their potential (uncommitted yet) changes.
But there is nothing left to commit as the changes have just been
notified. The quick create only waits for this to make the create
RPC, and thus totally ignores the changes that were committed at
the first place.
Task 1878254.