Autofocus in formview did not work when landing on the form view in
edit/create mode. This was because autofocus was called before the
formview was in the DOM.
Solution here in community is to defer the call to autofocus.
This revision is related to a9d20d9fa0.
`dataset.cache` contains an item for each records, even
if the records hasn't been loaded in the cache. If a record
has not been loaded, only the record id is available, not
the other values. Thefore, this isn't possible to validate
the record values of records that have not been loaded
in the dataset cache.
opw-654013
Warning messages are automatically displayed if a module takes more than 1000ms to load, but this delay is a bit short if you make multiple rpc calls (sorry for all the dead kittens)
It was bound to happen: some functionnality need to be triggered depending on the current edition of Odoo. To do this, we add a property 'version' on the global odoo object.
This change is mirrored on the enterprise repo.
6baf611d updated the image when showing the view form the first time,
but when reloading (e.g after a write) there was a difference which
would not cause the update.
second half of:
opw-654279
(follow-up of a8ae944)
When a warning is triggered by an onchange, clicking on "Save & Close"
will cause the warning to be closed as soon as it is shown. This fix
prevents the saving and closing if a warning message is detected.
opw-653503
In the following situation :
we click on an element inside a row (not the last row) which will:
-> open an alert, confirm or prompt dialog
-> remove the row containing the element
IE Edge would enter in a odd state where the focus is not given back to
the page, and clicking doesn't work anymore.
This fix solves this by detecting this situation and then focusing on an
input field which make IE Edge stop being crazy.
opw-653282
jsfiddle showing the issue: http://jsfiddle.net/ts8bsLLg/4/
jsfiddle showing a solution: http://jsfiddle.net/ts8bsLLg/6/
bug report on microsoft:
https://connect.microsoft.com/IE/feedbackdetail/view/1988284
note: applied in 9.0 community, 9.0 enterprise
The options dictionnary given when performing a do_action is now transmitted
to the client action initialization.
This was required for the mail client action, to correctly redirect to a given
channel.
Issue: steps to reproduce:
create a purchase order
choose a supplier
choose a product
change the quantity
don't click anywhere on the form, just click on "confirm order"
you get an error "invalid field: scheduled date"
Use dataset instead of record because record can have an other value (a short for a moment due to deferred).
Use silent option to avoid onchange.
The fix in 665bc1c solved the issue for pager of some X2Many widget x2m
which would shadow the accesskey to go to previous/next page of the top
view's current model.
But in the case a web.Pager (used in community for a X2Many kanban
widget) the fix had no effect.
opw-652888
This commit was necessary to fix weird problems in 9.0-nightly.
Phantomjs and the old nvd3 implementations did not play well together.
* transitionDuration() replaced by duration()
* tooltips() & tooltipContent replaced by tooltip.enable and tooltip.contentGenerator
* remove useless less for tooltip
Thanks to mge for his help
The issue occurs for example in the Sale dashboard, when the user
changes the target amount. If the user changes the value, then directly
clicks outside of the field, the method on_change_input will be called
twice: the first time because of the event 'change input', the second
time because of the event 'blur input'. This makes an unnecessary write,
which can cause an error due to concurrent access.
This prevents the execution of the write related to the event 'change
input' in this case. If the user changes the value but clicks on
'Enter', the focus is still on the field so the update is done
correctly.
Courtesy of Quentin Smetz (qsm@odoo.com)
opw-653086
When several accesskey with the same key, are defined on elements, the
last one (even if not displayed) is the one which will be actioned and
the key sequence is pressed.
This caused an issue since the "Pager" template is shared between all
elements, even the x2many relational widgets.
Also there was shortcut for Create/Save/Discard on the form view, but
those shortcuts should also be enabled in the list and kanban view.
closes#9267
opw-652888
o2m editable list open a form view and can put command as default value (record[this.name] for o2m in a o2m) for the editable fields.
When the onchange is triggered, get_value create a wrong command of command.
step to reproduce issue:
* edit a quotation with at least on sale order line
* change the pricelist
* change the quantity of the sale order line
todo : remove _on_load_record in version > 9.0 and use new dataset implementation with to_delete attribute
The method evict_record calls _update_cache with an empty dictionary,
which will not replace any cached value. Therefore, the cache is never
cleaned.
opw-652393
When an error occured while executing an action (e.g. access rights), the
action manager's state was inconsistent as inner_action, inner_widget and
action_stack were all updated before trying to execute the action. Then, if the
user tried to open another action, the screen was split into two because the
reference of the previous action was lost, and thus it couldn't be detached.
We now restore inner_action, inner_widget and action_stack to their previous
state in the case of a rejected deferred.
A better fix would be to update all three variables once the deferred is
resolved, but it would require a refactoring of the way the action manager
and the view manager communicate to perform the do_push_state and to compute
the breadcrumbs. Indeed, those operations directly rely on the internal state
of the action manager, and they are performed before the callbacks in
push_state are called. Such a refactoring should probably not be done in
stable.
Partly fixes#8886.
The problem was that the action manager wasn't notified at all when something
went wrong with the view manager as the deferred returned by appendTo was in
that case never resolved nor rejected.
Addon mail needs to know if we are using a touch device to set or not the
focus on the chat composer. However, this information was not available in
the community webclient.
In test mode, only one cursor is available, and longpolling will take
it, and not give it back before 60s, causing a phantomjs timeout. This
commit simply return an error when the server is in test mode.
Sadly, I had to patch the web client to prevent logging the error in
this case, because that's the way phantomjs detect if there is a
problem.
boot loader waited for only 100 ms before logging failed modules.
However, modules can now wait for deferred before completing their
loading, so this delay is increasingly getting too short.
Use case: create a new tag, change its color and create another new tag. The m2m field was rendered again but the dataset was not aware of the color change on the first new tag. We need to invalidate the cache after changing the color in a tag in edit mode.
* add CSRF token as core.csrf_token
* add CSRF tokens to client-generated and/or JS-submitted forms
* remove broken "compatibility" mode of web.ajax.post
/cc @dmo-odoo I've no idea how that was supposed to work, from looking
things up all modern browsers seem to support FormData, and old IEs
which don't don't support fallbacks either and would require
submitting an actual form as fallback so...
The template had been previously dropped by mistake.
+ the validation buttons were not correctly handled and so changing
his password was not possible (these buttons must be in the modal
footer).
The settings views are now using radio buttons which are using labels.
These were set to bold by bootstrap. Now force font-weight normal for
labels which are not labels inside an oe_form_group_cell_label (field
main label).
Like view manager containers, client action containers needed the
overflow:auto property to compute their correct height inside their
flex context. This also allows client action as the reconcilation in
accounting to not care about their height.
On webclient, on 'Attachment(s)' dropdown (form view) when clicking on an attachment to download it, a request is sent to /web/content/ with a param 't' containing the current date. This param wasn't used neither before the new controller, but the old one accept additional kwargs. The new controller crashes, and since the t parameter is not used, removing it seems better.