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 diff --git a/timesheet_description_sale/__init__.py b/timesheet_description_sale/__init__.py new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/timesheet_description_sale/__init__.py @@ -0,0 +1 @@ + diff --git a/timesheet_description_sale/__manifest__.py b/timesheet_description_sale/__manifest__.py new file mode 100644 index 00000000..122676b3 --- /dev/null +++ b/timesheet_description_sale/__manifest__.py @@ -0,0 +1,21 @@ +{ + 'name': 'Timesheet Description Sale', + 'version': '11.0.1.0.0', + 'author': 'Hibou Corp. ', + 'website': 'https://hibou.io/', + 'license': 'AGPL-3', + 'category': 'Tools', + 'complexity': 'easy', + 'description': """ +Linker module to inject fields required by timesheets for sales. + """, + 'depends': [ + 'timesheet_description', + 'sale_timesheet', + ], + 'data': [ + 'views/timesheet_views.xml', + ], + 'installable': True, + 'auto_install': True, +} diff --git a/timesheet_description_sale/views/timesheet_views.xml b/timesheet_description_sale/views/timesheet_views.xml new file mode 100644 index 00000000..f4d48acd --- /dev/null +++ b/timesheet_description_sale/views/timesheet_views.xml @@ -0,0 +1,19 @@ + + + + project.task.form.inherit + project.task + + + + {'default_project_id': project_id, 'default_task_id': active_id} + + + + + + + + + + \ No newline at end of file