From e1804f033c18ea6918b00a73db397dcd28055f4e Mon Sep 17 00:00:00 2001 From: Dhruv Patel Date: Fri, 29 May 2020 06:31:06 +0000 Subject: [FIX] mail: activities without summary added display false in export MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, activities having blank summary field exported in xls or csv display False. Instead of that, need to display the activity type like Email, To Do, Call, Meeting, etc. as its display in the list view. With this commit, if the activity type has summary then it will display summary value otherwise it will display the activity type name if summary is not added. Task : 2254851 closes odoo/odoo#58742 X-original-commit: 811edc466edbe9fc4b22e6f140cb5601612404f1 Signed-off-by: Sébastien Theys (seb) --- addons/mail/models/mail_activity.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'addons/mail/models/mail_activity.py') diff --git a/addons/mail/models/mail_activity.py b/addons/mail/models/mail_activity.py index e9a12639423..f79d0c44a11 100644 --- a/addons/mail/models/mail_activity.py +++ b/addons/mail/models/mail_activity.py @@ -406,6 +406,13 @@ class MailActivity(models.Model): {'type': 'activity_updated', 'activity_deleted': True}) return super(MailActivity, self).unlink() + def name_get(self): + res = [] + for record in self: + name = record.summary or record.activity_type_id.display_name + res.append((record.id, name)) + return res + # ------------------------------------------------------ # Business Methods # ------------------------------------------------------ -- cgit v1.2.3