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
Relation types are translatable, but translations does not work with virtual res.partner.relation.type.selection model
To Reproduce
Affected versions:
Tested with 12.0
Steps to reproduce the behavior:
Create more than ~10 relation types
Create a new relation
When selecting the type, choose "Search more..."
Expected behavior
Relation names should be translated in the list
name_get is implemented so it uses the names from res.partner.relation.type. This brought me to a work around where I replace the name values in a new read method:
@api.multi
def read(self, fields=None, load='_classic_read'):
""" Work around to get names translated """
result = super().read(fields=None, load='_classic_read')
if 'name' in fields or not fields:
try:
# Translation works with name_get
names = dict(self.name_get())
# Replace "name" value with the one from name_get
for record in result:
record['name'] = names[record['id']]
except:
pass
return result
The text was updated successfully, but these errors were encountered:
There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.
NL66278
added
no stale
Use this label to prevent the automated stale action from closing this PR/Issue.
and removed
stale
PR/Issue without recent activity, it'll be soon closed automatically.
labels
Mar 19, 2023
Module
partner_multi_relation
Describe the bug
Relation types are translatable, but translations does not work with virtual res.partner.relation.type.selection model
To Reproduce
Affected versions:
Tested with 12.0
Steps to reproduce the behavior:
Expected behavior
Relation names should be translated in the list
name_get is implemented so it uses the names from res.partner.relation.type. This brought me to a work around where I replace the name values in a new read method:
The text was updated successfully, but these errors were encountered: