Do not strip class by default on html fields, this was an error. Currently
only mail_message body field should not contain classes. Indeed as external
content can be stored through the mail gateway we do not want to keep the
classes.
Added the support of strip_classes, like the already existing strip_style
parameter of html fields.. This parameter is missing but allow full
customization of html fields.
Also fixed the call to the sanitizer in fields. Indeed the strict mode is
set to False. When not in strict mode the classes are never stripped whatever
the value of strip_classes.
Sanitizer is now called always in strict mode to ensure the sanitize process
is correct and really take into account strip_style and strip_classes.
This fix is done in master due to possible side effects and possible behavior
changes that are not welcomed in stable versions.
Those cases can now appear, since a model inheriting (with `_inherit`) from
another model can observe those extra fields from its parent model's class.
The recursion was based on an incorrect assumption: the cache of the target
environment is initially empty. If another computation left some value there,
the copying is incomplete, and that causes bugs in onchanges.
Accessing a related field with `related_sudo=True` on a draft record should
effectively traverse the fields as the admin user. Traversing new records in a
different cache requires that all new records on the path are copied across
caches. Make the copy across caches recursive when the first record on the
path is a new record.
This reverts commits
- 995b257a6c
- 2ebdb5f36e
- 748a719fd9.
The commit 748a719fd9 leads to an issue
bigger than what it aims to solve:
- as demo user
- create a new invoice
- add a new line
- select a product
-> traceback
opw-668141
Borrowing a cursor each time you access `field.digits` may be costly, because
of the connection reset. Moreover, in most cases, the cursor is not used at
all, since the decimal precision are kept in cache.
For the installation of module `product` with its demo data, the number of
cursor allocations was reduced from ~1500 to about 50!
Traversing new records in a different cache requires that all new records on
the path are copied across caches. Make the copy across caches recursive when
the first record on the path is a new record.
The serialization gives different results for some elements. For instance, an
empty element `i` must be serialized as `<i/>` in XML and `<i></i>` in HTML.
It must be done like that, otherwise the world (of web browsers) would break.
Add a test case for `html_translate`.
Such a field is declared as:
image = fields.Binary("Image", attachment=True)
With this option, the value of a binary field F is stored in an attachment with
`res_field=F`. When attachments are stored into the filestore, binary fields
are consequently stored in the filestore as well. Note that the option does
not work on old-API function fields.
By default searching on `ir.attachment` filters out attachments for binary
fields: the condition `res_field=False` is added to the domain unless a
condition on field `id` or `res_field` is already present. The client uses
`search_read` with a domain like `[('id', 'in', ids)]` for reading the data on
a form view. In that case, we should not filter out attachments that store
binary fields.
Also, do not filter search results for the superuser.