You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class ResPartner(models.Model):
_inherit = 'res.partner'
@api.depends('field_1', 'field_b')
def _compute_display_name(self):
for record in self:
record.display_name = 'This logic is irrelevant'
display_name = fields.Char(compute=_compute_display_name, store=True)
@pedrobaeza I am tagging you because I have a problem exactly the same as you had in the OCA module. Your solution in that module was to re-declare the display_name and re-add the store=True, however I am wondering if this cannot be fixed in Odoo core. If you have any insights I would value it highly.
I didn't investigate such problem, but it seems to fix it. It may be an ORM limitation, as a such, difficult to be fixed, and not for an stable version. Anyway, I let it tagged for reference.
Impacted versions:
Tested on 12.0
Steps to reproduce:
Create a new module "module_abc"
Create a second module "module_def"
Current behavior:
Once you've installed
module_abc
thedisplay_name
is storedOnce you install
module_def
thedisplay_name
is no longer storedEven though
module_def
does not change anything ondisplay_name
, the act of inheriting fromres.partner
will reverse what you have done inmodule_abc
This happens on any model, not only
res.partner
Expected behavior:
display_name
should be still be storedExtra references:
The text was updated successfully, but these errors were encountered: