add name_get method for show project in calendar screen

This commit is contained in:
Pawan Kumar 2021-03-23 11:32:15 +05:30
parent a716e7bdc2
commit 6b6c615a69
1 changed files with 9 additions and 0 deletions

View File

@ -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'):