diff options
| author | Martin Trigaux <mat@odoo.com> | 2019-01-10 14:47:10 +0000 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2019-01-10 15:06:21 +0000 |
| commit | ec2263080abba3b5385b13d381e8c934ef8f5657 (patch) | |
| tree | 3d4e29ce566199403389b1b6386d281e35deaf8c /addons/web/static/src/js/views/basic/basic_controller.js | |
| parent | 2b9f8452227f8cca9cd43d78c189accfc46dd16a (diff) | |
[FIX] fields: inherited fields keep parent's modules
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.
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_controller.js')
0 files changed, 0 insertions, 0 deletions
