From a form view (say Bill of materials)
Edit the form
Click on a bom line
Click on the external button that makes the product form pop up
change the order of suppliers on that product
Before this commit, a JS traceback was raised
This was because the changing object was not present in the localData that the Model object holds
or more accurately, it was not the **right** model object that was targetted
and this was due to the propagation of the resequence event
After this commit, no error is thrown, and the resequencing works as expected
OPW 807196
Backport of this commit: c13c9e0b5c
Steps to reproduce the bug:
- install application MRP Maintenance
- open maintenance request form view, and from top right corner click Studio icon
- click on Equipment field while you are still in studio interface
- It will show left side studio panel, click Domain box and it will throw an error
opw:813594
Set up the following kanban columns:
| Col 1 | Col 2 | Col 3 | Col 4 | Col 5 | Col 6 | F |
| | | | | | Card | |
<------- Screen width ---------->
Col x are unfolded columns.
F is a folded colum.
Moving the Card from Col 6 to F is impossible: the card won't go 'out of
the screen' on the right, which prevents its center to reach F.
Commit 5ba6d93810 deactivates the drag & drop on read-only fields.
In order to restrict the kanban cards displacements, the `containment`
attribute is used to either restrict the displacement:
- in `o_kanban_view` if draggable
- in the parent if not (to allow the resequence)
The class `o_kanban_view` is too restrictive: when movind the card to
the folded column F, the card must go out of `o_kanban_view`.
opw-803929
Before this commit, the boolean_toggle widget was rendered
but the less contained errors that prevented it from displaying correctly
This was due to commit 9dead7e3d3
After this commit, the widget displays correctly
There might be an issue in the future because of
field_utils.formatBoolean, when this function decides to pass the full options dict
OPW 80782
When a TZ mismatch is detected, the datetime value is displayed in the
widget. However, on MacOS, this forces the dropdown list to close at
each refresh of the value, which occurs every second.
The refresh interval is set to 1 minute in case of MacOS.
opw-804035
In df69b5bb the aggregates of a column with currency was shown only if
records were of the same currency when a grouping was closed.
But when the list view is grouped, this would cause a number of issue:
- error if with first grouping is opened, another one is closed
- if the first grouping was closed aggregates were always shown
- the code only acts when closing a grouping
- aggregates could be shown when they should not
- aggregates could be not shown when they should
So this commit change things so this feature is ignored when the list
view is grouped.
There is also a fix so `currency_field` of the column is used instead of
just using `currency_id` that may be wrong.
note: only for saas-14 and saas-15 (feature is not present in saas-16)
opw-810835
closes#22598
Url in the web client are supposed to open in a new tab. This was the
way it worked in v10.0 and was lost with the refactoring of the new
views.
We just reintroduce that behaviour with this commit.
Closes github issue #22389
- Set the OS to a GMT- timezone (e.g. 'America/Los Angeles')
- Set the format of the date to '%d/%m/%Y'
- Go to 'Account > Adviser > Journal Entries'
- Type '02-01-2018'
The suggested date is 31/01/2018.
Setting the moment object as UTC will lead to a conversion of the date
to the OS timezone when calling `toDate`, e.g.:
Mon Jan 31 2018 16:00:00 GMT-0800 (PST)
UTC should only be used in case of datetime, not date.
opw-803466
A `default_get` for a x2many field can return a new list of commands for one of
its x2many field, like
[[0, 0, {
'groups_id': [[6, 0, [1, 2, 3]]],
}]]
where [1, 2, 3] is a list of existing ids.
This use case was not correctly handled by the BasicModel because
`_makeDefaultRecord` was not recursive.
Closes#22401
When words are too long this may break out of a kanban tile and getting
everywhere.
This is not wanted and the content should be:
- hidden if overflown or
- long words should be wrapped or
- too long content should be ellipsed
The ellipsis is probably the best but this would affect the current
behavior (we would have to specify a max-height which unexpectedly
may be bothersome to currently existing data).
So breaking long words has been choosen in this change.
opw-806278
closes#22435
Let's assume an action with a 'group_by' specified in its context.
Unless another groupby is specified in the search view, the action
groupby must be used. For list views, it was only working for the
first rendering of the view. As soon as it was reloaded, the action
groupby was lost.
For instance, go to Project, click on a project in the dashboard
[the action has 'group_by': 'stage_id' in its context], switch to
list view [the list is correctly grouped by 'stage_id'], reload by
clicking on the view switcher -> the view isn't grouped anymore.
It was actually working by chance on other views because they have
specific handling of the groupby (e.g. the kanban view allows the
attribute 'default_group_by' on its arch), but by default, the
action groupby must always be used at each load/reload if there is
no other groupby specified.
This rev. restores the behavior of saas-15, before the new views.
In 60d9f6fe the ir.default replaced uses of ir.values.
But the [ir.default].set user_id has opposite meaning to
[ir.values].set_default for_all_users.
This was not taken into account when adapting javascript in 791152a87
and this commit fixes that.
opw-805871
closes#22437
With attribute 'on_create="quick_create"' on the arch's root node,
kanban views open the quick create widget in the first column when
the user clicks on 'Create' (in the control panel), if the view
is grouped and if there is at least one column. However, this
column may be folded.
Before this rev., the quick create was inserted into the folded
column, which didn't look amazing. This rev. first toggles the
column before inserting the quick create.
Before this commit, when having a kanban within a dashboard and clicking on an action button,
the action was not triggered, instead, the board form view triggered 'save' on the board model
leading to a server side traceback
After this commit, the action button triggers the demanded one and only this one.
OPW 805707
closes#22191closes#22371
Before this rev., it crashed when the user used the quick create
to create several records (very quickly, or on a slow network),
e.g. on crm.lead (there must be a date field on the kanban record
to reproduce the crash).
The crash occurred when the 'read' RPCs for the created records
return misordered. For instance:
1) 'name_create' record 1 (called and returned)
2) call 'read' for record 1
3) 'name_create' record 2 (called and returned)
4) call 'read' for record 2
5) 'read' for record 2 returns
6) 'read' for record 1 returns
At step 5, the kanban column was updated with the new state, but
this state already contained record 1, which wasn't fetched yet.
This rev. ensures that the created records are added to the state
once they are fetched and ready to be displayed, not before.
Introduce back part of `formatBinary` that was reverted with 7813a8e7.
When an image is unset, the value was `false` which would end up with a
bin_size of `NaN Bytes` which would end up displaying an error image
with source `data:image/png;base64,NaN Bytes`.
This commit get back a previous behavior so the bin_size when the
attachment does not exist is an empty string (so: '').
opw-805542
closes#22348
When creating a record with many default values, it could happen that
the number of ids returned by the default get (or onchange) exceeds the
limit for the form view.
For example, we can see the issue in the expenses list view. We can
increase the limit in the pager, to a value higher than 40. Then,
clicking on select all, then on 'Submit to manager' in the action menu
will result in a traceback.
The Submit to manager action will trigger a new action with a context key
'active_ids' with a large number of ids. After that, the web client
will execute the server actions, which will return a new action with a
context key 'default_expense_line_ids' with a bunch of ids. Then, it
will attempt to create a form view. This will call the
makeDefaultRecord method in the basic model. This method will generate
the commands for the one2many, for all ids, but will only load the 40
first sub records. After, it will attempt to apply the onchanges, with
some code that assumes that all operations of type 'ADD' correspond to a
local datapoint.
In this commit, we fix the code to properly work with operations of type
ADD with a res_id, but with no id. In that case, we simply generate a
command 'LINK_TO', since the value has not been changed.
opw 804370
When fetching x2manys in a x2many, the basic model did not properly sort
the internal data structure before fetching the data. This is usually
not an issue, except when we have an order which is different from the
order of the res_ids. In that case, it can cause crash in some
conditions, because the results from the fetchx2manybatched were applied
to the wrong datapoint.
To reproduce this issue, some specific conditions needs to be met. I
think that it is easier to refer to the test, instead of trying to
explain that.
In this commit, we properly sort the data at the correct place. Note
that this probably solves a bunch of other related issues, caused by the
fact that the internal structure was corrupted.
A timeout of 300 seconds is not enough anymore to run all tests on some
runbots (e.g. runbot12) or Odoo.sh installations. The duration on these
servers is often slightly over 300, leading to a failing test.
This increase is logical since unit tests are added on a regular basis.
opw-805418
opw-804621
Cleaning dead code from these commits that have been reverted:
41fe7f9d1113d026b226b136b4477aaaf9f1f638#diff-54fd886cc58f994ad518ee72df4d3edeR50
2a5488619da22cfd901963dd141e722b195e82ab#diff-f96b339a9374f74489f1f98755e9787bL9253
41fe7f9d1113d026b226b136b4477aaaf9f1f638#diff-86d6d41b5bb7499bf055258d05549d59R3111
With these final changes, we hope to stop the many issues that have occured with
binary fields, from these commits:
255e8ca3d97813a8e71441fe7f9d112a5488619d
What remains is the format of binary fields in list views without widgets,
which shows the bin_size instead of the base64 string representation...
... Rest assured, the computation is in JS, so there are no 'bin_size'
shenaningans!
Revision on 41fe7f9d11
This commit intended to reduce the network load when reading records with
binary fields. This was made possible by enforcing the contextual key
`bin_size` to be set for records with binary fields.
However, it is causing some issues (see #22222, #22231) which are:
- write with bin_size:true generates a traceback
- read/search_read with bin_size:true breaks some images
on some views (e.g. base.view_partner_form)
Since the problems outweight the gain of these changes, we revert them.
Field widgets now have a key 'context' that let them
extend the context of the dataPoint (e.g. list).
In particular, widgets on binary fields enforce the contextual
item {bin_size: True}, so that the server gives the size of the
binary field as its value, instead of its content.
This change on binary fields reduces network load when accessing
a view with binary fields.
Revert partially 255e8ca3d9
Removed widget 'download_link', as it was a sub-version of widget 'binary':
it did the exact same thing (representation of binary fields by means of a download link)
in a much better-looking way (download icon + filename as text of the download link,
instead of just a download link with text "Download").
Also, the values of binary fields might be already a human-readable binsize (e.g. 2.52 MBs),
instead of its plain textual string representation in base64:
The contextual parameter 'bin_size', when set to true, does not download the data of binary fields.
As a consequence, the server provides the sizes of the binary, instead of their value.
- In some languages the kanban images are not displayed because of a bug in human_size method in JS.
This method translates the Unit Size for data and strip with the string with a comma as separator.
When the translatation contains spaces after the commas (like in the French translation), there is extra spaces in the final result.
This then cause an issue with the method is_bin_size that expects a unique space between the value and its unit.
Resulting in a bug in the method 'kanban_image'.
opw #804973#804970#804648
For kanban views with attribute 'on_create="quick_create' set on
their root node, clicking on 'Create' in the control panel should
open the quick create widget in the first column if the view is
grouped and if there is at least one column displayed.
It was working as expected, except when there were no record yet.
This was because the kanban controller used the 'state.count'
attribute of the state (which indicates the total number of records
in the group), whereas it should have used 'state.data.length'
(which is the number of columns).
Before this rev., when quick creating a record in a grouped kanban
view, the quick create widget wasn't automatically re-opened, which
didn't allow the user to quickly create several records in a row
(without clicking each time on the '+').
This desired behavior had been broken by rev. 1d34e26, which aimed
to properly reload the kanban column when a record was created
(e.g. column counter, progress bar...).
When we have a form view with a one2many with an onchange, and with
lines which contains a x2many, and more lines that the limit (so more
than one page), and the read is not in the same order as what is
displayed because we have a widget=handle, then we might have a problem
when we delete one of the lines, if the onchanges tries to change the
x2many.
This is due to the fact that the order of the basicmodel datapoint is
not preserved by the various operations going around. I think that we
may still have a few other issues of this type, but it is actually quite
difficult to establish.
In any case, this situation is now properly handled.
opw 804530
The backend assets includes a list of the installed modules with:
```
odoo._modules = <t t-raw="get_modules_order()"/>;
```
Because of the randomization of Python 3.5 in the dict keys,
the order of the installed modules could change from time to
time, therefore making the assets being regenerated unnecessarily
This revision is a bit linked to the below one:
f3bb9ae679
In addition to have the dict keys always in the same
order, it's important for the values to always be
the same, and it was not the case for this list
which was in the content of the backend assets,
in various order.
opw-804747