From d2b6304a3246ea7d70bab995da44125b33654eb5 Mon Sep 17 00:00:00 2001 From: Kartik Chavda Date: Thu, 5 Aug 2021 05:46:00 +0000 Subject: [PATCH] [IMP] hr_timesheet: improve generic usage Purpose of this commit to improve ux for timesheet app. So, In this commit done following changes: - make name field of account.analytic.line model translatable by user. - changes in report of timesheet: - make generic table templete for timesheet. - changes label for employee_id field column 'responsible' into 'employee' and unit_amount field column 'time spent (hours)' into 'hours spent' and 'time spent (days)' into 'days spent'. - move name(description) field column right of the task column. - add timesheet entry report for project. - change internal project name when user has access to multiple companies. TaskId-2604773 closes odoo/odoo#75141 Related: odoo/enterprise#20242 Signed-off-by: Laurent Stukkens (ltu) --- addons/analytic/models/analytic_account.py | 2 +- addons/hr_timesheet/models/res_company.py | 2 +- .../report/report_timesheet_templates.xml | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/addons/analytic/models/analytic_account.py b/addons/analytic/models/analytic_account.py index 05c2226d799..d2c0e5febb6 100644 --- a/addons/analytic/models/analytic_account.py +++ b/addons/analytic/models/analytic_account.py @@ -179,7 +179,7 @@ class AccountAnalyticLine(models.Model): def _default_user(self): return self.env.context.get('user_id', self.env.user.id) - name = fields.Char('Description', required=True) + name = fields.Char('Description', required=True, translate=True) date = fields.Date('Date', required=True, index=True, default=fields.Date.context_today) amount = fields.Monetary('Amount', required=True, default=0.0) unit_amount = fields.Float('Quantity', default=0.0) diff --git a/addons/hr_timesheet/models/res_company.py b/addons/hr_timesheet/models/res_company.py index 888c8ae7225..de1ba261311 100644 --- a/addons/hr_timesheet/models/res_company.py +++ b/addons/hr_timesheet/models/res_company.py @@ -61,7 +61,7 @@ class ResCompany(models.Model): for company in self: company = company.with_company(company) results += [{ - 'name': _('Internal'), + 'name': _('Internal - %s', company.name), 'allow_timesheets': True, 'company_id': company.id, 'type_ids': type_ids, diff --git a/addons/hr_timesheet/report/report_timesheet_templates.xml b/addons/hr_timesheet/report/report_timesheet_templates.xml index 129161b90c0..4db110b6613 100644 --- a/addons/hr_timesheet/report/report_timesheet_templates.xml +++ b/addons/hr_timesheet/report/report_timesheet_templates.xml @@ -6,13 +6,13 @@ Date - Responsible - Description + Employee Project Task + Description - Time Spent (Days) - Time Spent (Hours) + Days Spent + Hours Spent @@ -25,15 +25,15 @@ - - - + + +