FIX get_name for study #3

Closed
b0g wants to merge 6 commits from 16.0-pre-release-fix into 16.0
Showing only changes of commit 8cb35a4640 - Show all commits

View File

@@ -102,8 +102,13 @@ class StudyStudy(models.Model):
default = dict(default or {}, identifier_primary_id=None) default = dict(default or {}, identifier_primary_id=None)
return super().copy(default) return super().copy(default)
@api.depends("title", "name")
def name_get(self): @api.depends("title", "name")
if not self.name: def name_get(self):
return [(study.id, study.title) for study in self] result = []
return [(study.id, f"[{study.name}] {study.title}") for study in self] for study in self:
if not study.name:
result.append((study.id, study.title))
else:
result.append((study.id, f"[{study.name}] {study.title}"))
return result