summaryrefslogtreecommitdiff
path: root/odoo/addons/test_new_api/ir.model.access.csv
AgeCommit message (Collapse)Author
2019-02-06[FIX] fields: setting an integer field invalidates its inverse one2manyXavierDo
In particular, creating a `mail.message` automatically invalidates the corresponding `record.message_ids`. closes odoo/odoo#30737
2019-01-29[IMP] fields: forbid required m2o ondelete set nullAdrian Torres
A many2one field that is required means that its column cannot contain null values, however the default ondelete policy for all m2o fields is `set null`, which contradicts `required=True`. This patch will, by default, apply the `restrict` policy to required m2o fields unless the ondelete attribute is explicitly specified. However, if the policy specified is `set null`, a ValueError will be raised whenever the registry registers the field as this makes no sense. The default ondelete policy remains unchanged for non-required m2o fields (set null) closes odoo/odoo#30122
2019-01-28[MERGE] forward port branch saas-12.1 up to d3b8422c9c4Christophe Simonis
closes odoo/odoo#30614
2019-01-17[FIX] base: merge contacts linked to by an o2m field with capsLucas Perais (lpe)
Define a field on a model as: - o2m to res.partner - the field's column, hence its name, has capital letters in it (studio does that) create two objects of that class, each one linked to a different partner with the new o2m merge the partners Before this commit, the object linked to the second partner, was deleted This was because merge partner sql requests did not quote the column name After this commit, the second object still exists OPW 1925060 closes odoo/odoo#30300
2019-01-16[IMP] fields: check for inconsistent many2many definitionsRaphael Collet
closes odoo/odoo#29323
2018-11-14[FIX] fields, test_new_api: monetary related customLucas Perais (lpe)
This commit allows for not copying the currency_field attribute of a monetary field when the monetary field is related, and when the currency_field attribute is not explicit Before this commit, the currency_field attribute on the related monetary was set as the one on the distant model After this commit, the currency_field attribute takes the field on the current model Though the test may appear like an incoherent use case, it is on the contrary totally legit, as web_studio allows it OPW 1903113 closes odoo/odoo#28144
2018-10-03[ADD] *: support SVG imagesPedro M. Baeza
Introduce official support for SVG files in the framework, including the following parts: 1. When client-side SVG images are uploaded, the content is displayed until you save using data URI scheme according RFC 2397 [1]. This scheme requires to specify content format. Using hardcoded "image/png" works for all images types except SVG. Type-sniffing is done using "magic byte" detection via the first base64 encode byte, so that the proper data URI scheme can be used. This should not cause SVG-related security problems as the file is displayed through `<img>` tag, which does not allow SVG scripting [2]. 2. Make /web/image controller compatible with SVG 3. Add support for SVG files for company logo, which uses a dedicated controller. 4. Resizing of SVG files is a no-op, as it makes little sense for a vector-based format. We also want to avoid micro-alterations to the SVG document (in "natural" viewport parameters) as we would store multiple copies of the files in the filestore. 5. Because SVG files are inherently dangerous, upload of SVG files is restricted to administrators, either by blocking it directly before saving it in the database (binary fields with attachment=False), or by neutering them to text/plain mimetype (for binary fields with attachment=True) 6. Add tests for the SVG upload cases and for the non-admin uploads. [1] https://tools.ietf.org/html/rfc2397 [2] https://www.w3.org/wiki/SVG_Security Closes #26635
2018-01-23[FIX] models: behavior with multiple inverse/compute mixed on same fieldsRaphael Collet
2018-01-23[IMP] api: make the implementation of field protection more robustRaphael Collet
2018-01-12[IMP] field: compute transitive dependencies over non-stored fieldsRaphael Collet
In other words, when a field F depends on a non-stored field G, it also depends on G's dependencies. This guarantees that whenever a dependency of G is modified, F will be invalidated and marked to recompute (if necessary). The transitive closure of dependencies is not computed over stored fields. Anyway stored fields already trigger the recomputation of their dependent fields during their recomputation. The performance impact on the loading of a registry is negligible (less than 1%), and the increase of recomputation triggers is small (less than 10%).
2017-09-13[FIX] models: in `onchange`, consider all levels of subfieldsRaphael Collet
2017-04-13[MERGE] forward port branch saas-14 up to 8f30e707e53Christophe Simonis
2017-04-11[FIX] fields: recompute recursive stored fieldsRaphael Collet
2017-03-28[MERGE] forward port branch saas-14 up to 2f68e9e93a1Christophe Simonis
2017-03-23[FIX] models: ensure recomputation after inversing fields (#15683)Raphael Collet
When updating record using "record.field = value", we need to ensure that all fields in cache depending on "record.field" will be recomputed.
2017-03-17[MERGE] forward port branch saas-14 up to b2fa9f2ad1dChristophe Simonis
2017-03-16[FIX] expression: improve o2m with m2o integerNicolas Lempereur
We sometimes use in Odoo a One2many field with an inverse Integer field instead of a usual Many2one. This allow for example in several instances to have a "Many2one" which can be reference from several models, eg: Model Ranking: name = String field res_id = Integer field res_model = String field Model Toy: rank = One2many [inverse: Ranking -> res_id] [domain: res_model == Toy] Model Tool: rank = One2many [inverse: Ranking -> res_id] [domain: res_model == Tool] This enable us to have a shared feature between otherwise unrelated models. But there was several issue when searching on these One2many: 1) if the Integer Many2one was not stored (eg. it came from an inherits) on the searched model, this could lead to an error. 2) when we searched: - by IDs (rank in ['55']) with at least one id not respecting the domain - by IDs with a negative operator - with a negative operator on unfound string (rank != "no rank has this") - with a false value (rank = False) we would not apply the One2many domain (eg. res_model == Toy) and thus possibly getting Toy 3 errenously because a Tool 3 was found without the domain being applied. This fix modify the search on One2many and for: 1. if the inverse is an Integer not stored field instead of Many2one manage it. 2. if the field is an Integer field instead of Many2one and there is a domain on the One2many: apply the domain on the inverse model found. So only some search on One2many with a domain whose inverse field is an Integer could be impacted. This would also be nice to have for all One2many with a domain but the probability of it being useful versus risk for performance is not judged high enough. opw-710508
2017-01-19[REF] move support for sparse fields into a separate module (#15070)Raphael Collet
This removal has led to a necessary refactoring: - make the setup of field attributes extensible; - make the instantiation of custom fields extensible; - delegate model and field reflection to `ir.model` and `ir.model.fields`; - move the implementation of sparse and serialized fields to module `base_sparse_field`;
2016-09-02[REF] openerp: move `openerp` to `odoo`Raphael Collet