| Age | Commit message (Collapse) | Author |
|
This commit introduce a full redesign of all JS views. We started
basically from scratch. The goal was to unify all the various views
under a common framework, to make them testable, to make then usable in
different conditions (in studio, or in the frontend), and to make our
lives easier.
Some important points are:
- we introduced new coding guidelines (camelCase, 80 chars width, ...)
- we have a brand new testing framework (still QUnit based)
- kanban view moved to the web addon
- calendar view (formerly web_calender) moved to web as well
- the tree view was removed
- all new code should be documented
We hope that this code is the start of a new era for the Odoo web
client, we want to have a high quality codebase, well documented, well
tested, well designed.
Work done by the framework team: mostly aab, ged, chm, dmo, qsm
|
|
|
|
The editable list has a `is_valid` method which checks that all the
records it contains have valid data. The problem is that it was
considering that all the records in the `dataset.cache` were part of
the x2x field the editable list is working with. This is wrong as the
`dataset.cache` can contain information which are not part of the
editable list anymore.
See the commit which introduced the use of the `dataset.cache`:
a9d20d9fa04b1dbb350663652e0996e258ac6d31
This was causing issues with rare cases of an editable list which
contains another editable list (even invisible) which was sharing
common information with its parent editable list.
opw-710627
|
|
|
|
The revision
dd657c42f7cbac01294ef794bf0e697ed495c722
intended to give the possibility to add an existing
record to a many2many list even without the `create` access
on the model of this record.
This is accepted by the ORM, as there is no need of the create
right on the model, only the write on the source model on which
the many2many field is.
The revision has as unexpected side effect to remove the possibility
to manually set `create="0"` on the tree of a many2many field,
to hide the "add an item" of the list view.
As this last feature is more important, we therefore revert this.
We will provide another solution for the above issue.
We think about forcing what the view definition says, so if you
set create="1" on the view, it will display the "add an item" link
in any case, even if you do not have the access right to do it.
This would allow to display the link for the above case, and in case
you actually do not have the access right, and this is an error
in the view definition, you will have an access error raised anyway.
opw-708310
|
|
|
|
|
|
One can add an item in a Many2Many without creating it, so the action
should be available. However, if the create action is not allowed, there
is no 'Create' button in the SelectCreateDialog.
|
|
|
|
|
|
|
|
Be a little less strict when not showing o2m list view warning so if the
o2m is not editable (a modal is open instead of editing inline) we still
show warnings.
Also have warnings over modal overlays so they can be used for modals.
opw-702333
|
|
|
|
|
|
|
|
|
|
Rev. 3f7d350fe21d9e2afb35a9ce3e2652940e3f259d1 introduced
auto-cancellation of the edit mode when the user clicks
outside the edited line.
The unfortunate downside was the auto-cancellation of the
edit mode also when the user presses ENTER while the
line is not valid.
This is especially annoying when using barcode scanners to
fill in values, as scanners usually send an ENTER keystroke
at the end of the input sequence.
When a many2one field is focused this event will often occur
before the autocompletion popup has a chance to open. At that
point the line is considered invalid, and the edition mode
is cancelled! If no field is considered dirty yet on the line
this simply drops the whole line, otherwise it will open a
navigation confirmation popup. Both results equally prevent
the use of barcode scanners.
This patch makes sure the edit mode is only cancelled when the
user indeed clicked outside the line, and not for other cases
where save() is requested, such as an ENTER keystroke.
|
|
|
|
|
|
|
|
With this change, form_relational_widgets will wait for the 'web.ListEditor'
module to be loaded before patching the list view. This is particularly
important for wizards containing and editable list view.
Note that to achieve this, I had to fix a horrible hack in session.
|
|
* Tip are never destroyed when change view mode
* unbind methods
* mail: memory leak with unbind methods
* web: memory leak because 'ui-autocomplete' is never destroyed
* web_editor: memory leak for wrong unbind on destroy
* web: memory leak: must remove fileupload handler
* bus: memory leak: correctly debind handlers on window in bus.Bus
* remove handlers on switch buttons and views $buttons
* remove handlers on breadcrumbs
* web: memory leak: correctly debind handlers
* im_odoo_support: memory leak: remove fileupload handler odoo_support
Note: part of this commit was actually authored by aab
|
|
Before this commit, the one2many widget was not displayed if no data.
That make some form (notebook) empty while the user don't click en edit to see the widget appear.
Eg: stock picking 'Initial Demand' tab
Courtesy of @ged-odoo
|
|
|
|
|
|
|
|
|
|
The widget test if all lines are valid to save the view, but the test include the removed lines (eg: required field).
|
|
|
|
get_formview_action and get_formview_id are methods used notably in a
redirection called from a mail controller used in notification emails.
Those methods however are defined as cr, uid, id and are interpreted
as api.one when called by a new-api style method.
With modules being converted into the new API, those methods are called
as api.one and the result is encapsulated into a list.
To avoid having to take the first element of the returned list we decided
to simplify the call chain and migrate the methods as multi methods, using
ids instead of id. Various addons have been updated accordingly. A temporary
support of ids being an int / long has been added to avoid conflict with calls
using id (for example if javascript is not updated).
|
|
|
|
Since the deduplication of web addons (977db823c7c84e9edc7c8cf8384eb9cf47275b3a),
patch 9062c01c0298dd254197e5100ff9f23725f7e46f (freshly forward-ported)
is now useless. Apply odoo/enterprise@26adf4fe2cc89743e31f5540ef5de803185930a2 couterpart.
|
|
|
|
|
|
|
|
|
|
|
|
When browsing a form with a one2many / many2many field
with several pages, the one2many pager page was not reset
when going to the previous/next record, while the next/previous
record could not have multiple pages on its one2many/many2many,
and the page on which the user was on the former record could
not exist in the newly displayed record.
Besides, even if the page does exist, there is no reason
to display this new record X2many value from its first page.
It's the case anyway when you edit/save, it comes back to the first page.
opw-679092
|
|
_('foo '+bar) does not work as `bar` is a variable with undefinied content
during translation export (and variable content during evaluation) so a match
will not be found.
Also trailing spaces are stripped during synchronisation with transifex.
The proper syntax would be
_.str.sprintf(_t("foo %s"), bar)
but to avoid breaking existing translations (need to reexport .pot)
use the syntax
_("foo ") + " " + bar
that is more stable friendly.
The 'No value found for the field...' string is not possible to be fixed without
breaking the translations should be split at least twice.
Write it the propre way directly.
|
|
For `this.viewmanager.active_view` to be set, the view manager
switch mode must be completed, meaning the deferred returned by
the function `switch_mode` must be resolved
(see `this.active_view = view;` in `view_manager.js`, line 146)
In a 2many field, the view manager `switch_mode` deferred is resolved
when `is_loaded` of this field is as well resolved.
Before this revision, clicking fast on Save then Edit
of a vendor bills resulted to a JS error due to a race condition,
because `this.viewmanager.active_view` was undefined when
the field was not loaded / the view manager switch mode not completed.
opw-678097
|
|
If the method return false, when a user write require="1" on a x2many field, the content is valid that there have none or a value.
The method was overwrited for a visual change (display the field x2m in readonly mode when they are not value) but is_false is priority use to ensure datas.
|
|
|
|
This reverts commit c43a97f353b76e211cad939a1c02c06e8ee724b7.
If you use a setTimeout in your js code, you might want to have a
serious look at what you are doing. You are almost certainly doing it
wrong.
If you chain a deferred with the number returned from a setTimeout, you
definitely don't know what you are doing.
If you try to fix editable list view by magically adding timeout,
potentially inversing the order of execution, and without understanding
how deferred works, it is clear that you are just changing stuff until
your particular bug disappear in your particular case, and that you have
no idea what other bugs you just introduced.
Please study how deferred works, how the basic JS methods works, learn
what setTimeout returns. Also, you might want to have a basic
understanding of how and when expressions are evaluated. For example,
if you cannot explain why a if statement cannot be replaced by a
function, you might want to stop what you are doing and educate yourself.
|
|
1/ On create new record focus field should select already existing value of field,
So user doesn't have to remove the old value first and then enter new value.
2/ Avoid the double empty line creation when pressing enter
step to produce
1 Menu Point of Sale > Configuration > Point of Sale switch to form view
2 Tick the box "Cash Control" , the one2many field will be visible
3 Press the "Tab" from keybord , control jumps to "Add an item" button
4 Press "Enter" from keyboad
5 You will see one extra line will be added..
|
|
|
|
M2O use the autocomplete lib to display its content. The problem is
that if a result is empty (or only composed of whitespaces), a
divider is displayed in the dropdown.
Commit 1d9f7d279a74aaf6aaf25f91e2313b23b4122827 was fixing this by only displaying non-empty
name results... but it did not work as many models implement the
name_search method the wrong way.
The new solution is to add a default display for record values which
are empty strings, at the right places in the webclient components.
|
|
Before this commit, many2many list views in wizards did not
handle the blur event at all, which means that the last edited
line was ignored. This is quite a large bug, but not really
visible in our standard install, because we had no many2many
in wizards.
This commit add naive support for blur events. This is only
intended to help the MRP team. A complete solution would
probably involve moving most of the code in One2ManyListView
to X2ManyListView.
|
|
Avoid duplicating web addon in enterprise by extracting a common basis.
Enterprise features stay in enterprise, but use that common basis.
Mainly:
- JS refactoring and linting
- Conversion of .sass into .less split into multiple files
- Templates cleaning and DOM simplification
- Re-generation of web.pot, and update of .po files
|
|
|
|
|