URL attachments are now returned as data and not redirection.
If the url does not match with a module file, the 301 status
(redirection) is still returned.
This allows to use the /web/image/<xmlid>/<dimension> route
and get an image attachment with correct dimensions.
with the recent update of nvd3 to the last version, we fixed a lot of
tooltip issues, but we introduced at least a new problem: when a view
is detached from the dom with a visible tooltip, it no longer is cleaned
up.
In this commit, we simply remove all nvtooltips when we detach a kanban
view (necessary because dashboards inherits from kanban). This is not
really an elegant way to solve the issue, but at least it works. any
improvement is welcome.
In some cases the Referer HTTP header may be missing or
stripped by a proxy, browser extension or anti-virus.
This breaks debug mode because it was solely relying
on the Referer header.
Introducing an explicit X-Debug-Mode header for RPC
calls allows for an alternative method that works
even when the Referer is missing.
This won't work in all cases, e.g. for direct $.ajax
calls, for example.
Closes#9824
Some accounting model (i.e. account.tax) are redefining the ORM search
method, but with misordered arguments (placing count as fifth argument
instead of context).
For the export function, this lead to have the "context" variable
associated to the "count" function variable. As "count" is then
considered as True, the method returns the number of records instead
of the list of record ids. This then exported the last record (the
count'th one) instead of all the records that matched the domain.
The solution here is to explicitly give the context variable by name.
- Differentiate between the Community and Enterprise editions
in the version number. By adding this attribute on the global
odoo JS object in the web client bootstrap controller /web,
we can differentiate between versions easily on the client
side without extra RPC calls.
- Remove a couple of version-related RPC calls in case
the global version info is present in the JS environment
- Update "About" panel to display the edition info
- This commit also reverts 07fe5afc87
which implemented the idea in a more limited way.
Closes#9625
The legend of the graph when there was too much items in it could
prevent user to see a part or even the whole graph.
On non-mobile device, move the Pie Chart legend to the right, thus if it
overflows the char is still visible and we can toggle the seen top
legend item.
Otherway, the legend on top is hidden when :
- there is more than 25 legend items and the device has width < 768
- there is more than 50 legend items and the device has 768 <= width < 992
- there is more than 75 legend items and the device has 992 <= width < 1200
- there is more than 100 legend items and the device has 1200 <= width
Since this is based only on the number of legend items but legend items
could have variable name lengths, there will still be edge case where
the legend obstruct the graphical data display.
In this situation the current way to cope with this further filter the
displayed data.
opw-653445
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.
These onchanges were needless since it was already done by the
BufferedDataSet when we use alter_ids to add/remove ids/virtual ids from
the recordset.
The onchanges this commit remove were introduced with 6b907bb4d in
juliet 2012 whilst the onchange in the BufferedDataSet when using
dataset alter_ids was with dd747c096 in october 2012.
closes#8273fixes#7595
opw-644706
Partial backport of master (-> v9) commit 059230512.
for the issue when removing an invoice line from an account.invoice,
three onchange where triggered:
- ListView account.invoice.line unlink the line id from its dataset,
[[first onchange]]
-> the line id is removed from the dataset which trigger an onchange
after this is done (and the onchange is finished), the following
onchange happen:
-- remove each record of the Collection of the ListView
-> this remove the id of these record from the ListView List dataset
[[second onchange]]
-> this trigger an onchange albeit the dataset is not changed
(since it was already removed before the first onchange)
-> this trigger an onchange on the one2many_list of the ListView
which has the same dataset as the ListView
[[third onchange]]
-> so an onchange is called yet again.
this commit removes the second onchange in this case where we remove ids
already removed from the dataset.
closes#8273fixes#7595
opw-644706
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 a selection field with widget="radio" is False, the form view display the previews value for this field.
1 - Create a selection field (ex: [("1", "1"), ("2", "2")]), and display it on a form vue.
2 - Go to the form view (all the record have False value for this field).
3 - Change the value of this field for one record.
4 - In readonly mode, all other records now wrongly display this value (still False in DB or when "edit").
#opw-652002
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
When clicking on a breadcrumb taking us to a previous view, we should
restore that view action and not keep the current one.
closes#9075
opw-652039
note: no forward-port needed
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