Add the corresponding content type document instead the default content type.
This allows browser to detect the type of file being downloaded.
Fixes#1225
Before this revision, the `char_domain` re-rendered its display
only when its domain value was changed.
It must re-render as well when the model on which this domain
is applied is changed, as the number of records can
obviously be different.
e.g., in mass-mailing, when changing the recipients type
from partners to leads, the domain doesn't change, it
stays `['opt_out', '=', False]`, but the model on which
this domain is applied does change, as well as the number
of selected records.
opw-658391
'write_function' transfer the options to 'write' method from the popup form
Steps to reproduce:
1. Create custom model to add a product quantity on hand(readonly) field on stock.move
2. Show this field on Warehouse>All operations>Create a Transfer> Create: Internal Moves
3. Add a Internal Move, then open it again, the quantity on hand field's value show 0. But change the product, the value is correct.
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
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
This reverts commit bd9cbdfc41.
The above revision solved the SQL constraints not being
translated when raised. They were not translated because
the context, containing the lang, was not located as expected
in the `kwargs` dict.
While it solved this issue, it had as side-effect to raise
`current transaction is aborted,
commands ignored until end of transaction block` errors more
often when using the web client.
This can be explained by the double check, when the first
check raised this error
- which can happen, e.g. when the cursor is closed,
there is a retry mechanism in such cases -
and by the fact the transaction was not rollbacked.
This issue could have been solved as well by rollbacking
the transaction, but it is regarded as not-so-clean.
Therefore, to solve this issue, while still having
the SQL constraints translated, we apply the
second patch proposed in bd9cbdfc41
commit message, which is not-so-clean as well, but
which is a proper solution.
opw-651393
To reproduce use a form view with a one2many editable list and create a lot of lines. Then click a few times quickly on the delete.
If the user click at least two times on delete of a same record, the dataset add the id in "to_delete" the virtual id because "to_create" doesn't contains the virtual id of the record deleted previously.
E.g.: create a "Customer Payments" and select a "Customer" and "Payment Method" who generate a lot of "Credits" lines.
The structure `filename*=UTF-8` works in Safari, from
release 6.2 (which is set as version 537 in the user_agent version).
This structure has the advantage to handle the UTF-8 encoding,
and therefore special characters, such as accents.
Therefore, from this Safari release, we use the same format
than other browser. For older releases, we use the format
`filename=`, without UTF-8, ASCII encoded, replacing
special characters by `?`.
opw-649863
The widget SelectCreatePopup display the search view drawer directly
after the search view input field. But in current firefox version this
could lead to an issue with float positionning.
fixes#8462
opw-648999
The `check` decorator expects the context to be in the `kwargs`
or to be the last arguments of the method.
The `call_kw` route, which is decorated by the `check` decorator,
like every route,
expands its kwargs arguments.
Therefore, once in the `check` decorator,
the context is located in the `kwargs` key
of the kwargs.
(More simply, instead of
`kwargs.get('context', {})`
it's
`kwargs.get('kwargs', {}).get('context', {})`
As the context is not retrieved correctly,
the lang is not set correctly either,
and the sql constraints were not translated.
In 7.0, it worked, because there was a double
check, as the call_kw was called trough an rpc
(`dispatch_rpc`) call,
which was decorated by the `check` as well.
As a fix for 8.0, we apply the same logic,
we perform a double check, with an indirection.
The check decorator should probably be
refactored, but this cannot be done
in a stable release such as 8.0.
Closes#3634
On a first edition of a view list editable, scrolling before the first
edition might cause an issue: the editing fields are higher than they
should.
This commit solves this.
This issue stems from jQuery .offset({value}) function which is broken
if the element we want to position:
- is in absolute postionning,
- is inside a scrolled element in non static positionning,
- has not both top and left css property setted,
- has no ancestor element between itself and the scrolled not in static
positionning.
This issue happens less (and probably not at all) in saas-6 since the
last condition is most often not met thanks to this change:
https://github.com/odoo/odoo/commit/1ccd87a#diff-27c072074221456684bfc5f150ca0bc9R876
This issue of jquery is solved since jquery 3.0.0-alpha1:
https://github.com/jquery/jquery/commit/2d71594
( the issue is shown in https://jsfiddle.net/wpjrnggf/ and we can see it
is solved with jQuery 3.0.0-alpha1 https://jsfiddle.net/L6ykpjgy/ )
closes#8251
opw-647622
In internet explorer, writing direction can lead to wrong text direction
when combined with rotate.
A fix was already in place for IE up to version 9 but the issue also
happens in next versions which are more difficult to differentiate
(especially the current spartan/edge version).
So this fix use the same css property value for all browser and it doesn't
seem to have an impact (other than correcting the issue in IE).
closes#7955
opw-646430