From 6b6c615a69cb17ebf1972b41aeda8819beab1d68 Mon Sep 17 00:00:00 2001 From: Pawan Kumar Date: Tue, 23 Mar 2021 11:32:15 +0530 Subject: [PATCH] add name_get method for show project in calendar screen --- cor_custom/models/analytic.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cor_custom/models/analytic.py b/cor_custom/models/analytic.py index 106263f..c20d34d 100755 --- a/cor_custom/models/analytic.py +++ b/cor_custom/models/analytic.py @@ -14,6 +14,15 @@ import dateutil.parser class AccountAnalyticLine(models.Model): _inherit = 'account.analytic.line' + @api.depends('project_id', 'employee_id') + def name_get(self): + res = [] + for record in self: + if record.project_id.name: + name = record.project_id.name + '/' + record.name + res.append((record.id, name)) + return res + def _domain_project_id(self): domain = [('allow_timesheets', '=', True),('is_sub_project', '=', False)] if not self.user_has_groups('hr_timesheet.group_timesheet_manager'):