summaryrefslogtreecommitdiff
path: root/odoo/fields.py
AgeCommit message (Collapse)Author
2019-09-06[MERGE] forward port branch 12.0 up to 82a8cdd6f2fChristophe Simonis
2019-09-06[MERGE] forward port branch saas-11.3 up to 091aa331905Christophe Simonis
2019-09-06[FIX] models: callable in api.depends() sees valid _rec_nameRaphael Collet
Determine `model._rec_name` before the dependencies of the fields. The compute method of the automatic field `display_name` uses a callable depends that retrieves `model._rec_name`. closes odoo/odoo#36480 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-05-31[MERGE] forward port branch 12.0 up to 8f21148e1a8Christophe Simonis
2019-05-28[MERGE] forward port branch 11.0 up to a20a31486cdChristophe Simonis
2019-05-28[MERGE] forward port branch saas-15 up to cad0be27e71Christophe Simonis
2019-05-28[MERGE] forward port branch saas-14 up to 6b6d2c8455dChristophe Simonis
2019-05-28[MERGE] forward port branch 10.0 up to 01020e18e91Christophe Simonis
2019-05-27[IMP] doc: add information about index attributeFlorent de Labarre
closes odoo/odoo#32606 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-29[MERGE] forward port branch saas-11.3 up to 8a0e819d0bbChristophe Simonis
2019-05-28[FIX] fields: inherit context_dependent from parent fieldsMartin Trigaux
If a field is inherited from another model, the attribute context_dependent was not propagated correctly. Example of bug: >>> product = self.env['product.product'].search([], limit=1) >>> product.name 'Whiteboard Pen' >>> product.with_context(lang='fr_FR').name 'Whiteboard Pen' # cache used >>> template = product.product_tmpl_id >>> template.name 'Whiteboard Pen' >>> template.with_context(lang='fr_FR').name 'Marqueur pour Tableau Blanc' >>> product._fields['name'].context_dependent False >>> template._fields['name'].context_dependent True Fixes odoo/odoo#33641 Closes odoo/odoo#33722 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-05-21[FIX] fields: recursive stored fieldsRaphael Collet
The compute method of a recursive field must be invoked on single records even when several records are marked to recompute. closes odoo/odoo#33529 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-05-02[MERGE] forward port branch 11.0 up to 82c901c9379Christophe Simonis
2019-04-26[FIX] In new records *2many, enable to handle multiple RPC inputsmreficent
closes odoo/odoo#24458 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-04-08[MERGE] forward port branch 11.0 up to 9a7e3c8b498Christophe Simonis
2019-05-03[MERGE] forward port branch saas-12.1 up to 2420492c264Christophe Simonis
2019-05-03[MERGE] forward port branch 12.0 up to d7c0c5c127bChristophe Simonis
2019-05-02[MERGE] forward port branch saas-11.3 up to 2c68df0ab43Christophe Simonis
2019-04-09[MERGE] forward port branch 12.0 up to ea1fc124efcChristophe Simonis
2019-04-08[MERGE] forward port branch saas-11.3 up to 4c61621efbbChristophe Simonis
2019-04-04[FIX] orm: don't crash on index creationDamien Bouvy
Creating field indexes might not always be possible. For instance, adding an index on an existing Char/Text field will fail if the column contains values longer than 8192 bytes (PostgreSQL limit for BTrees). Instead of failing miserably during the schema modification, simply log the problem and continue. closes odoo/odoo#32416 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-03-19[MERGE] forward port branch 12.0 up to 82c4393fd02Christophe Simonis
2019-03-05[MERGE] forward port branch 11.0 up to 27081bf6f5fChristophe Simonis
2019-03-15[FIX] fields: safe check on ondelete cascadeNans Lefebvre
In the case of attachment_ids, comodel._fields[inverse] can be res_id, an integer field. Such fields do not have a default ondelete attribute. opw 1945926 closes odoo/odoo#31864 Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-04-09[MERGE] forward port branch saas-12.1 up to 6d4940675f1Christophe Simonis
2019-03-21[MERGE] forward port branch saas-12.1 up to 6878c9f3424Christophe Simonis
2019-03-11[MERGE] forward port branch saas-12.1 up to 2b3296bbf8bChristophe Simonis
2019-03-08[MERGE] forward port branch 12.0 up to c023d0784f2Christophe Simonis
2019-02-22[MERGE] forward port branch saas-12.1 up to 0f4abc5c228Christophe Simonis
2019-02-21[MERGE] forward port branch 12.0 up to 84143a34b31Christophe Simonis
2019-02-20[MERGE] forward port branch 11.0 up to de8cefcef4dChristophe Simonis
2019-02-20[MERGE] forward port branch saas-11.3 up to 2c495502aa3Christophe Simonis
2019-02-14[MERGE] forward port branch saas-14 up to c1fe9f18d5aChristophe Simonis
2019-02-14[MERGE] forward port branch 10.0 up to 69719f598aaChristophe Simonis
2019-02-13[FIX] fields: read/write company-dependent fields without ir.property accessLucas Perais (lpe)
This is the first step to a more comprehensive handling of company-dependent fields which are ir_properties. With model-specific access rights, users should be able to read/update a company-dependent field no matter their access rights on ir_property. Before this commit, a user having access to res.partner, but not to ir.property couldn't write on property_account_receivable/payable just because he couldn't write the corresponding ir.property. After this commit, he can. OPW 1923345
2019-02-13[FIX] fields: read/write company-dependent fields without ir.property accessLucas Perais (lpe)
This is the first step to a more comprehensive handling of company-dependent fields which are ir_properties. With model-specific access rights, users should be able to read/update a company-dependent field no matter their access rights on ir_property. Before this commit, a user having access to res.partner, but not to ir.property couldn't write on property_account_receivable/payable just because he couldn't write the corresponding ir.property. After this commit, he can. OPW 1923345
2019-02-14[MERGE] forward port branch saas-15 up to c0f24d54cfaChristophe Simonis
2019-02-07[IMP] fields: dummy updates of one2many fields should not trigger recomputationsRaphael Collet
2019-02-06[IMP] access errors through related fieldsXavier Morel
When an access error bubbles through a related field (aka the user doesn't have access to the delegate or the delegate's field), append the "intermediate step" so that it's easier to understand e.g. that the access error to a partner really comes from accessing a user or somesuch.
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[MERGE] forward port branch 11.0 up to 36d96e01503Christophe Simonis
2019-01-10[FIX] fields: inherited fields keep parent's modulesMartin Trigaux
On a field created through a _inherits, the fields on the child model did not benefit from the parent _modules information. If two models are created in module base class Partner(models.Model): _name = 'res.partner' class User(models.Model): _inherits = {'res.partner': 'partner_id'} partner_id = fields.Many2one('res.partner') and a second module auth_signup adds a field on the parent model class ResPartner(models.Model): _inherit = 'res.partner' signup_token = fields.Char() Both res.users and res.partner should have an ir.model.data create base_setup.field_res_partner__signup_token was correctly created but base_setup.field_res_users__signup_token was not created The reason is was, in the call to _reflect_model, since 574f4c3deb2671b7, the creation of ir.model.data is based on the field._modules However, the field res.partner.signup_token did not propagate its _modules value to the related field res.users.signup_token With this patch, both ir.model.data are created. This allow a proper uninstallation of fields as well as translation.
2019-01-03[IMP] api: gain some memory by not creating the cache_key tuple multiple timesDenis Ledoux
2019-02-11[IMP] fields: faster convert_to_record for many2one fieldsDenis Ledoux
Use `env.registry` instead of `env` to get the comodel as a class instead of an instance, which saves one call to `_browse` each time we access a relational field. This saves time because of the cost of `object.__new__` and prefetch update in `_browse`.
2019-02-11[IMP] fields: faster `record.id` accessDenis Ledoux
This is a partial backport of revision ed32700925132943fc4957ae2f43deaeeec7a278 to speed up the access of browse record id field.
2019-01-14[MERGE] forward port branch 12.0 up to 6a0675d36ddChristophe Simonis
2019-01-09[MERGE] forward port branch 12.0 up to 3e4138deaa2Christophe Simonis
closes odoo/odoo#30045
2018-12-11[MERGE] forward port branch saas-14 up to 5a147acf1beChristophe Simonis
2018-12-11[MERGE] forward port branch 10.0 up to f69c004795eChristophe Simonis
2018-12-12[MERGE] forward port branch 12.0 up to 047e2b28de4Christophe Simonis