Before this commit, the web client did not properly destroy field
widgets when updating a one2many after an onchange. This is rarely an
issue, because in general, there are no other field widgets besides the
row currently in edition. However, if we specify explicitely a widget,
or if we use a custom widget, it may be a problem.
- correctly update the pager when a record is added or removed
- destroy the widgets of the removed row when the user clicks on
'Cancel' when creating a new record
- ensure that the list always contains 4 rows (before this rev.,
in list views with less than 4 records, if the user created a
new record, then clicked on 'Discard', there were only 3 rows
left
- properly destroy field widgets when removed from the DOM
Note that the change of parent.parentID to parent.static is not a
bug fix, but it's better to use the key that indicates the type of
list element, instead of implying it from other attributes.
* account, maintenance, mrp, payment, point_of_sale, sales_team
Previous system was:
- `flex: 1 1 300px;` on kanban records
- If a specific record needs a different size, add custom style to
either change the `flex` rule or set a `min-width` for >=SM screens
Now:
- `flex: 1 1 auto;` and `width: 300px;` on kanban records
- If a specific record needs a different size, add custom style to
change the `width` rule.
This allows some standardization of the way to customize the suited
width and also allow lesser LESS code (as the previous version required
either the use of the flex mixin or the use of a media query).
Note:
- Also remove useless app record rule
- Also fix MRP Work Centers record width
Note2:
This system should be improved for version 12.0.
Form views with a chatter in a dialog on a large screen are styled by
the side chatter feature. This is not a problem as it is made to be
automatically adapted whether a chatter is displayed or hidden, but
in-dialog only rules had to be adapted.
- Fix several contexts where the emoji popover was hidden by a webclient
element (control panel / ...). To solve this bug, the design has been
improved to not use popover but instead use custom design (better
integrated with new chatter design)
- Chat window is now still usable when a modal is opened
- Simplify chatter LESS
After the refactoring of the wkhtmltopdf engine, the headers/footers are managed in a very different way to be able to call wkhtmltopdf only once. The subst JS function must select the right header/footer corresponding to the current page company. However, a <div> was suppressed during the process and then, some external customization might be ignored (see github issue for more details).
-issue: https://github.com/odoo/odoo/issues/19544
Go to General Settings, click on 'Change Document Template', and
in the opened dialog, click on a template.
Before this rev., it automatically closed the dialog, which was
not really convenient.
This rev. introduces a new field widget (image_selection) for
this use case, and ensures that the dialog doesn't close when
a template is selected.
Test written by @mba-odoo
In this commit, we make sure that if an onchange in a x2many modifies
another line, then the new data is properly shown. This is quite
tricky, because the field x2many ignores the full extent of the changes.
Also, we obviously want to preserve the editing state (focused field,
...)
So, what we actually do is to rerender the full x2many (minus the new
line) to make sure that we preserve the correct row order.
Note: thanks to MGE for the test and some preliminary work.
Since the rev. https://github.com/odoo/odoo/commit/2728fe1ec1ac7e99819d0f30f29a1814b00c82a4 the onchange create
command (0) send the virtual id as second argument. This argument is sent
back from the server and can then be used by the client.
As the client knows the virtual id, it can easily reuse the datapoint created
for this record and thus avoid creating a new one.
Creating a new datapoint can potentially lead to problems if the record has
for example specialData, that won't be kept.
The FieldDomain allows to open a list in a dialog to display the
records matching the current domain. In this dialog, clicking on
a record should do nothing (this was the behavior before the new
views).
Before this rev., it actually tried to open the record and it
produced a crash.
Scenario: Go to any list or kanban view: go to next page and set a
filter that matches less that 'limit' record (e.g. less than 40),
but at least one. No record will be displayed, because the offset
is kept for the search_read.
This rev. ensures to reset the offset to 0 when a search is done
using the searchview.
When the mockserver handles an unimplemented route, it just log an
error. This is annoying because it does not break the QUnit suite, so
if the developer does not look at the console, it will look like the
test suite pass. However, the runbot will see that as an error.
With this commit, we throw an error to force the test suite to fail in
that case.
Before this commit, there was a crash when sorting a one2many in a form view.
This is due to the fact that the event from the one2many bubbled up to
the main form view, which basically assumed that it was supposed to sort
some sub one2many.
It could be seen for example when editing a 'attribute' in a product
form view (need to activate variants), then sorting the 'attribute
values' sub one2many.
With this commit, we simply stop the event propagation at the correct
level.
- Load more was invisible; now also add a little bit of styling
- Small column records were not centered in their column
- Add a column padding bottom to allow seeing reaching the scrollend
- Column create was misaligned since some padding changes
The `upgrade_boolean` widget should display an `Enterprise` label next to it.
There is however an issue when a `label` is specified for this field. In this case,
the `Enterprise` label should be placed next to the field label (and not the field
itself).
The easiest solution would have been to instantiate the field widget with its label,
but this can't work because the field widget is instantiated before its label.
We thus re-render the widget after its label creation.
It allows to see only records from a given model without allowing to
change the model. It gives a better experience to users that choose
records using a reference field when the model comes from some other
choice and should not be changed.
KanbanColumn instances are saved in an array in the renderer. The quick
create widget is always put in the first column found in this array.
Unfortunately, the array elements' order was broken after some
operations where column(s) are rerendered (like moving records).
- List view: sortable icon, do not force position to right
- Mail: do not vertically reposition systray's icons
- Form view: oe_subtotal_footer, minor design imp
The server postproccess the view to add attributes on many2one fields, i.e.
`can_create` and `can_write`, according to access rights.
These attributes are parsed by the client as string but should also be parsed by
the many2one when evaluating them.
The mock server has also been adapted to set these attributes.
* crm, project
Add a new feature which allows to put a progressbar in the kanban
columns. The progressbar shows with the same color the amount of
records whose value of a given field are the same in the column.
It also indicate the sum of another given field or simply the total
number of records. It also allows to subgroup the column content.
To define a progressbar, add this as a direct child of the kanban
arch:
<progressbar field="<name of the field to use for subgroups>"
colors="{<one possible value for the above field>: <success, warning or danger>, ...}"
sum="<name of the field to sum or nothing to use total number of records>"/>
Also:
- Properly update record model data's parentID when moving a record
- ...
Before this commit, asking the basic model for a 'read_group' operation
was automatically followed by other operations to read groups content
('search_read', 'read', ...). This commit introduces an option to only
perform a 'read_group'.
Before this commit, when a record was moved in a kanban view, the
model saved the record change then manually updated the related groups
(to avoid performing a read_group and reloading the whole view). This
manual update can in fact be performed before the record save. This
allows customizing the save operation in some cases where a real
read_group would be needed.
Normal flow for one record's changes to be saved is:
0) (use `_setValue` for fields)
1) `trigger_up('field_changed')`
2) field manager mixin: `_onFieldChanged`
3) model: apply changes and save
4) controller: `_confirmSave`
Kanban records are using another system for an unknown reason. This
system was calling the right model functions but was not calling the
controller `_confirmSave` and was instead re-coding it. This commit
makes sure that `_confirmSave` is now called.
Performing a 'read_group' was creating new model group data which were
saving some properties of the old model group data. As KanbanColumn
widgets may not be updated in each case where we might want to re-do
a (partial) 'read_group', this commit changes the system so that old
model group data are simply updated with the useful new group data
properties (instead of being entirely replaced).
Previous kanban header was a div with `flex-flow: row nowrap`. So if
someone tried to add some stuff in it, it will be forced to stay on
the same row as the title and config buttons. This commit wraps these
row elements in a new div to allow kanban header customization (this
prepares for the kanban progressbars).
Move a record from one column to another in a kanban grouped by a selection field
leads to a traceback.
A selection field value is composed of a tuple ('value', 'String') and the write
command must send the `value` and not the `String` as it was done before this rev.
Clicking on a cell that contains a button (but not ON the button) leads to
a traceback (see "Scrap" button in Stock Operation for example).
This is due to the fact that a button is not registered as a widget so it can't
be activated.
This commit ensures that the next line is selected if the last column is a
buttton.