Merge branch 'pawan_branch' into 'development'

add name_get method for show project in calendar screen

See merge request prakash.jain/cor-odoo!156
This commit is contained in:
pawan.sharma 2021-03-23 04:37:33 -07:00
commit 8f7fb53acb
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'):