diff --git a/helpdesk_mgmt_timesheet/README.rst b/helpdesk_mgmt_timesheet/README.rst new file mode 100644 index 0000000000..cd51f5bb59 --- /dev/null +++ b/helpdesk_mgmt_timesheet/README.rst @@ -0,0 +1,114 @@ +========================= +Helpdesk Ticket Timesheet +========================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhelpdesk-lightgray.png?logo=github + :target: https://github.com/OCA/helpdesk/tree/12.0/helpdesk_mgmt_timesheet + :alt: OCA/helpdesk +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/helpdesk-12-0/helpdesk-12-0-helpdesk_mgmt_timesheet + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/282/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds Timesheet funcionality in Helpdesk module. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +To configure this module, you need to: + +#. Allow Timesheet for a Helpdesk's Team +#. Set a Default Project (optional) + +Allow Timesheet +~~~~~~~~~~~~~~~ + +#. Go to Helpdesk > Configuration > Teams. +#. Edit or create a new team. +#. Check Allow Timesheet option to allow timesheets for that team. +#. Select a Project for that team (optional). + +Usage +===== + +#. Go to *Helpdesk* or *Helpdesk > Dashboard* to see the tickets dashboard. +#. In the Kanban view, click in the kanban card of a team to see their tickets and create new ones. +#. If there is not a Default Project you will need select a Project for the Ticket to show the Timesheet Table. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Aresoltec Canarias +* Punt Sistemes +* SDi Soluciones Digitales +* Solvos + +Contributors +~~~~~~~~~~~~ + +* `Aresoltec Canarias, S.L `_: + + * Inma Sánchez + +* `SDi Soluciones, S.L. `_: + + * Oscar Soto + * Jorge Luis Quinteros + +* `Punt Sistemes, S.L. `_: + + * Carlos Ramos + +* `Solvos Consultoría Informática, S.L. `_: + + * David Alonso + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/helpdesk `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/helpdesk_mgmt_timesheet/__manifest__.py b/helpdesk_mgmt_timesheet/__manifest__.py index 4081087517..a8dadad541 100644 --- a/helpdesk_mgmt_timesheet/__manifest__.py +++ b/helpdesk_mgmt_timesheet/__manifest__.py @@ -1,6 +1,7 @@ # Copyright (C) 2020 Aresoltec Canarias # Copyright (C) 2020 Punt Sistemes # Copyright (C) 2020 SDi Soluciones Digitales +# Copyright (C) 2020 Solvos Consultoría Informática # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { @@ -20,9 +21,12 @@ 'hr_timesheet', ], 'data': [ - 'security/helpdesk_mgmt_timesheet_security.xml', 'views/helpdesk_team_view.xml', 'views/helpdesk_ticket_view.xml', 'views/hr_timesheet_view.xml', - ] + 'report/report_timesheet_templates.xml', + ], + 'demo': [ + 'demo/helpdesk_mgmt_timesheet_demo.xml', + ], } diff --git a/helpdesk_mgmt_timesheet/demo/helpdesk_mgmt_timesheet_demo.xml b/helpdesk_mgmt_timesheet/demo/helpdesk_mgmt_timesheet_demo.xml new file mode 100644 index 0000000000..1cb85083d4 --- /dev/null +++ b/helpdesk_mgmt_timesheet/demo/helpdesk_mgmt_timesheet_demo.xml @@ -0,0 +1,44 @@ + + + + + + Helpdesk general project + + + + Helpdesk general task + + + + + + + + + + + + + + + + + + Initial analysis + + + + + + + + Resolution + + + + + + + + diff --git a/helpdesk_mgmt_timesheet/models/helpdesk_ticket.py b/helpdesk_mgmt_timesheet/models/helpdesk_ticket.py index d8cad205f0..3e32e21c1e 100644 --- a/helpdesk_mgmt_timesheet/models/helpdesk_ticket.py +++ b/helpdesk_mgmt_timesheet/models/helpdesk_ticket.py @@ -33,14 +33,14 @@ class HelpdeskTicket(models.Model): string='Timesheet', ) total_hours = fields.Float( - compute='impute_hours', + compute='_compute_total_hours', readonly=True, store=True, string='Total Hours' ) @api.depends('timesheet_ids.unit_amount') - def impute_hours(self): + def _compute_total_hours(self): for record in self: record.total_hours = sum( record.timesheet_ids.mapped('unit_amount') diff --git a/helpdesk_mgmt_timesheet/models/helpdesk_ticket_team.py b/helpdesk_mgmt_timesheet/models/helpdesk_ticket_team.py index 26265fe580..5fe3aa4c9d 100644 --- a/helpdesk_mgmt_timesheet/models/helpdesk_ticket_team.py +++ b/helpdesk_mgmt_timesheet/models/helpdesk_ticket_team.py @@ -14,14 +14,8 @@ class HelpdeskTicketTeam(models.Model): comodel_name='project.project', string='Default Project', ) - reset_default_project = fields.Boolean( - string='Reset Project', - ) @api.constrains('allow_timesheet') def _constrains_allow_timesheet(self): if not self.allow_timesheet: self.default_project = False - - def action_clear(self): - self.default_project_id = False diff --git a/helpdesk_mgmt_timesheet/models/hr_timesheet.py b/helpdesk_mgmt_timesheet/models/hr_timesheet.py index 1cef8be38b..98bd7f2318 100644 --- a/helpdesk_mgmt_timesheet/models/hr_timesheet.py +++ b/helpdesk_mgmt_timesheet/models/hr_timesheet.py @@ -10,6 +10,7 @@ class AccountAnalyticLine(models.Model): ticket_id = fields.Many2one( comodel_name='helpdesk.ticket', string='Ticket', + domain=[("project_id", "!=", False)], groups="helpdesk_mgmt.group_helpdesk_user", ) ticket_partner_id = fields.Many2one( diff --git a/helpdesk_mgmt_timesheet/report/report_timesheet_templates.xml b/helpdesk_mgmt_timesheet/report/report_timesheet_templates.xml new file mode 100644 index 0000000000..3fe477107f --- /dev/null +++ b/helpdesk_mgmt_timesheet/report/report_timesheet_templates.xml @@ -0,0 +1,21 @@ + + + + diff --git a/helpdesk_mgmt_timesheet/security/helpdesk_mgmt_timesheet_security.xml b/helpdesk_mgmt_timesheet/security/helpdesk_mgmt_timesheet_security.xml deleted file mode 100644 index c275c1b58f..0000000000 --- a/helpdesk_mgmt_timesheet/security/helpdesk_mgmt_timesheet_security.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/helpdesk_mgmt_timesheet/static/description/index.html b/helpdesk_mgmt_timesheet/static/description/index.html new file mode 100644 index 0000000000..a26e7f3bb7 --- /dev/null +++ b/helpdesk_mgmt_timesheet/static/description/index.html @@ -0,0 +1,468 @@ + + + + + + +Helpdesk Ticket Timesheet + + + +
+

Helpdesk Ticket Timesheet

+ + +

Beta License: AGPL-3 OCA/helpdesk Translate me on Weblate Try me on Runbot

+

This module adds Timesheet funcionality in Helpdesk module.

+

Table of contents

+ +
+

Configuration

+

To configure this module, you need to:

+
    +
  1. Allow Timesheet for a Helpdesk’s Team
  2. +
  3. Set a Default Project (optional)
  4. +
+
+

Allow Timesheet

+
    +
  1. Go to Helpdesk > Configuration > Teams.
  2. +
  3. Edit or create a new team.
  4. +
  5. Check Allow Timesheet option to allow timesheets for that team.
  6. +
  7. Select a Project for that team (optional).
  8. +
+
+
+
+

Usage

+
    +
  1. Go to Helpdesk or Helpdesk > Dashboard to see the tickets dashboard.
  2. +
  3. In the Kanban view, click in the kanban card of a team to see their tickets and create new ones.
  4. +
  5. If there is not a Default Project you will need select a Project for the Ticket to show the Timesheet Table.
  6. +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Aresoltec Canarias
  • +
  • Punt Sistemes
  • +
  • SDi Soluciones Digitales
  • +
  • Solvos
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/helpdesk project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/helpdesk_mgmt_timesheet/tests/test_helpdesk_mgmt_timesheet.py b/helpdesk_mgmt_timesheet/tests/test_helpdesk_mgmt_timesheet.py index 12cc8d2c32..fdcb67a606 100644 --- a/helpdesk_mgmt_timesheet/tests/test_helpdesk_mgmt_timesheet.py +++ b/helpdesk_mgmt_timesheet/tests/test_helpdesk_mgmt_timesheet.py @@ -25,7 +25,6 @@ def setUpClass(cls): def generate_timesheet(self, ticket, hours=1.0): return self.env['account.analytic.line'].create({ 'amount': 0, - #'company_id': 1, 'date': fields.Date.today(), 'name': 'Test Timesheet', 'unit_amount': hours, diff --git a/helpdesk_mgmt_timesheet/views/helpdesk_team_view.xml b/helpdesk_mgmt_timesheet/views/helpdesk_team_view.xml index d8a4f13c48..6ae4e33f05 100644 --- a/helpdesk_mgmt_timesheet/views/helpdesk_team_view.xml +++ b/helpdesk_mgmt_timesheet/views/helpdesk_team_view.xml @@ -9,9 +9,6 @@ - diff --git a/helpdesk_mgmt_timesheet/views/helpdesk_ticket_view.xml b/helpdesk_mgmt_timesheet/views/helpdesk_ticket_view.xml index b9c2c9000f..570c42742d 100644 --- a/helpdesk_mgmt_timesheet/views/helpdesk_ticket_view.xml +++ b/helpdesk_mgmt_timesheet/views/helpdesk_ticket_view.xml @@ -7,9 +7,11 @@ - @@ -25,9 +27,12 @@ remaining_hours < 0 - - - + + + @@ -42,7 +47,8 @@ - + diff --git a/helpdesk_mgmt_timesheet/views/hr_timesheet_view.xml b/helpdesk_mgmt_timesheet/views/hr_timesheet_view.xml index 8688e94e57..a08a60e4ef 100644 --- a/helpdesk_mgmt_timesheet/views/hr_timesheet_view.xml +++ b/helpdesk_mgmt_timesheet/views/hr_timesheet_view.xml @@ -28,7 +28,7 @@ - + @@ -38,8 +38,7 @@ - + @@ -78,6 +77,7 @@ name="Timesheets" parent="helpdesk_mgmt.helpdesk_ticket_main_menu" action="helpdesk_timesheet_action" + groups="hr_timesheet.group_hr_timesheet_user" sequence="15"/>