From 27be0df5b3b242e36b62d3cd3e98f188330e137d Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Wed, 23 May 2018 11:47:37 -0700 Subject: [PATCH 01/13] Initial commit of `timesheet_description` and `timesheet_description_sale` for 11.0 -- Forces popup for timesheet (detail) and allows you to display them as Markdown in the portal. --- timesheet_description/__init__.py | 1 + timesheet_description/__manifest__.py | 24 ++++++++++ timesheet_description/models/__init__.py | 1 + timesheet_description/models/timesheet.py | 23 ++++++++++ .../views/project_templates.xml | 9 ++++ .../views/timesheet_views.xml | 46 +++++++++++++++++++ 6 files changed, 104 insertions(+) create mode 100644 timesheet_description/__init__.py create mode 100644 timesheet_description/__manifest__.py create mode 100644 timesheet_description/models/__init__.py create mode 100644 timesheet_description/models/timesheet.py create mode 100644 timesheet_description/views/project_templates.xml create mode 100644 timesheet_description/views/timesheet_views.xml diff --git a/timesheet_description/__init__.py b/timesheet_description/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/timesheet_description/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/timesheet_description/__manifest__.py b/timesheet_description/__manifest__.py new file mode 100644 index 00000000..2bc871a1 --- /dev/null +++ b/timesheet_description/__manifest__.py @@ -0,0 +1,24 @@ +{ + 'name': 'Timesheet Description', + 'version': '11.0.1.0.0', + 'author': 'Hibou Corp. ', + 'website': 'https://hibou.io/', + 'license': 'AGPL-3', + 'category': 'Tools', + 'complexity': 'easy', + 'description': """ +Timesheet entries will be made in a form view, allowing the end user to enter more descriptive timesheet entries. + +Optionally, allows you to display your timesheet entries in markdown on the front end of the website. + """, + 'depends': [ + 'project', + 'hr_timesheet', + ], + 'data': [ + 'views/project_templates.xml', + 'views/timesheet_views.xml', + ], + 'installable': True, + 'auto_install': False, +} diff --git a/timesheet_description/models/__init__.py b/timesheet_description/models/__init__.py new file mode 100644 index 00000000..1b7bb1fb --- /dev/null +++ b/timesheet_description/models/__init__.py @@ -0,0 +1 @@ +from . import timesheet diff --git a/timesheet_description/models/timesheet.py b/timesheet_description/models/timesheet.py new file mode 100644 index 00000000..30cd3401 --- /dev/null +++ b/timesheet_description/models/timesheet.py @@ -0,0 +1,23 @@ +try: + from markdown import markdown +except ImportError: + markdown = None + +from odoo import api, fields, models + + +class AnalyticLine(models.Model): + _inherit = 'account.analytic.line' + + name_markdown = fields.Html(compute='_compute_name_markdown') + + @api.multi + def _compute_name_markdown(self): + if not markdown: + for line in self: + # Why not just name? Because it needs to be escaped. + # Use nothing to indicate that it shouldn't be used. + line.name_markdown = '' + else: + for line in self: + line.name_markdown = markdown(line.name) diff --git a/timesheet_description/views/project_templates.xml b/timesheet_description/views/project_templates.xml new file mode 100644 index 00000000..e2d78d0b --- /dev/null +++ b/timesheet_description/views/project_templates.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/timesheet_description/views/timesheet_views.xml b/timesheet_description/views/timesheet_views.xml new file mode 100644 index 00000000..640a616a --- /dev/null +++ b/timesheet_description/views/timesheet_views.xml @@ -0,0 +1,46 @@ + + + + project.task.form.inherit + project.task + + + + {'default_project_id': project_id, 'default_task_id': active_id} + + + + + +
+ + + + + + + + + + + + + + + +
+
+
+
+ + + account.analytic.line.tree.hr_timesheet.inherit + account.analytic.line + + + + + + + +
\ No newline at end of file From b5d59d2e89cb1d902dfd033e6595e59ae5d651c9 Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Sat, 25 May 2019 17:00:39 -0600 Subject: [PATCH 02/13] MIG `timesheet_description` on 12.0 --- timesheet_description/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timesheet_description/__manifest__.py b/timesheet_description/__manifest__.py index 2bc871a1..090b3f75 100644 --- a/timesheet_description/__manifest__.py +++ b/timesheet_description/__manifest__.py @@ -1,6 +1,6 @@ { 'name': 'Timesheet Description', - 'version': '11.0.1.0.0', + 'version': '12.0.1.0.0', 'author': 'Hibou Corp. ', 'website': 'https://hibou.io/', 'license': 'AGPL-3', From e14a2be0354f3aa2330abdb738455da1249b835a Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Fri, 3 Jul 2020 12:43:26 -0700 Subject: [PATCH 03/13] [MIG] timesheet_description: to Odoo 13.0 --- timesheet_description/__manifest__.py | 2 +- timesheet_description/models/timesheet.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/timesheet_description/__manifest__.py b/timesheet_description/__manifest__.py index 090b3f75..63724af7 100644 --- a/timesheet_description/__manifest__.py +++ b/timesheet_description/__manifest__.py @@ -1,6 +1,6 @@ { 'name': 'Timesheet Description', - 'version': '12.0.1.0.0', + 'version': '13.0.1.0.0', 'author': 'Hibou Corp. ', 'website': 'https://hibou.io/', 'license': 'AGPL-3', diff --git a/timesheet_description/models/timesheet.py b/timesheet_description/models/timesheet.py index 30cd3401..30b71e43 100644 --- a/timesheet_description/models/timesheet.py +++ b/timesheet_description/models/timesheet.py @@ -11,7 +11,6 @@ class AnalyticLine(models.Model): name_markdown = fields.Html(compute='_compute_name_markdown') - @api.multi def _compute_name_markdown(self): if not markdown: for line in self: From 45c4a6237a69c90d04b4198c03c56474f904cf5a Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Tue, 29 Sep 2020 15:12:33 -0700 Subject: [PATCH 04/13] [FIX] timesheet_description: portal view position and semantics --- timesheet_description/views/project_templates.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/timesheet_description/views/project_templates.xml b/timesheet_description/views/project_templates.xml index e2d78d0b..c9e84a23 100644 --- a/timesheet_description/views/project_templates.xml +++ b/timesheet_description/views/project_templates.xml @@ -1,9 +1,8 @@ \ No newline at end of file From 66880a1f0499b551fdc98a3908663828389a1146 Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Tue, 29 Sep 2020 15:36:11 -0700 Subject: [PATCH 05/13] [FIX] timesheet_description: portal view position and semantics --- timesheet_description/views/project_templates.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/timesheet_description/views/project_templates.xml b/timesheet_description/views/project_templates.xml index c9e84a23..d691233c 100644 --- a/timesheet_description/views/project_templates.xml +++ b/timesheet_description/views/project_templates.xml @@ -1,8 +1,9 @@ -