| Age | Commit message (Collapse) | Author |
|
|
|
|
|
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>
|
|
|
|
|
|
|
|
|
|
|
|
closes odoo/odoo#32606
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
|
|
|
|
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>
|
|
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>
|
|
|
|
closes odoo/odoo#24458
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>
|
|
|
|
|
|
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
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
|
|
|
|
|
|
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.
|
|
In particular, creating a `mail.message` automatically invalidates the
corresponding `record.message_ids`.
closes odoo/odoo#30737
|
|
|
|
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.
|
|
|
|
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`.
|
|
This is a partial backport of revision
ed32700925132943fc4957ae2f43deaeeec7a278
to speed up the access of browse record id field.
|
|
|
|
closes odoo/odoo#30045
|
|
|
|
|
|
|