Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][MIG] helpdesk_mgmt_timesheet : Migration to 15.0 #425

Merged
merged 23 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5e4b27c
[ADD] helpdesk_mgmt_timesheet: original files from PR #121
dalonsod Jul 28, 2020
7a92477
[IMP] helpdesk_mgmt_timesheet: black, isort
Aug 23, 2020
f1780bb
[MIG] helpdesk_mgmt_timesheet: Migration to 13.0
Aug 23, 2020
fe363df
Translated using Weblate (Spanish)
dalonsod Aug 24, 2020
b7c1711
[FIX] Helpdesk Management Timesheet
gdgellatly Oct 19, 2020
44265f5
[13.0][FIX] Names in pages is necesary to inherit
Jan 4, 2021
ad1c640
[IMP] helpdesk_mgmt_timesheet: filter tickets with activity on timesh…
dalonsod Feb 11, 2021
f967fda
Added translation using Weblate (Hungarian)
tdombos Apr 16, 2021
cf18137
helpdesk_mgmt_timesheet 13.0.1.0.2
OCA-git-bot Apr 27, 2021
d4d5f1c
[13.0][FIX]helpdesk_mgmt_timesheet: default_project not a field in he…
manuelregidor May 6, 2021
0cffc1c
helpdesk_mgmt_timesheet 13.0.1.1.0
OCA-git-bot Jul 28, 2021
e6fd79e
[IMP] helpdesk_mgmt_timesheet: black, isort, prettier
Aug 18, 2021
f89d2ef
[MIG] helpdesk_mgmt_timesheet: Migration to 14.0
Aug 18, 2021
eff5dcb
Added translation using Weblate (Spanish (Argentina))
ibuioli Sep 11, 2021
5b71065
[FIX] helpdesk_mgmt: remove obsolete 'view_type'
MiquelRForgeFlow Feb 25, 2022
767c657
Added translation using Weblate (Italian)
francesco-ooops Mar 24, 2022
504a703
Translated using Weblate (Italian)
SicurSam Mar 25, 2022
1b743ae
Translated using Weblate (Italian)
francesco-ooops Mar 25, 2022
aee9b74
Added translation using Weblate (French)
remi-filament May 31, 2022
2ece5b6
[MIG] helpdesk_mgmt_timesheet: Migration to 15.0
manuelcalerosolis Jun 28, 2022
db90ad7
[FIX] helpdesk_mgmt_timesheet: adapt for merged project_timesheet_tim…
vincent-hatakeyama Jan 20, 2023
8a8c1c4
[FIX] helpdesk_mgmt_timesheet: Ticket submit broken
ypapouin May 10, 2023
644a3f2
[ADD] helpdesk_mgmt_timesheet: add optional ticket field in view
SergiCForgeFlow Jun 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion helpdesk_mgmt/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def _prepare_submit_ticket_vals(self, **kw):
.with_company(company.id)
.default_get(["stage_id"])["stage_id"],
}
if company.helpdesk_mgmt_portal_select_team:
if company.helpdesk_mgmt_portal_select_team and kw.get("team"):
team = (
http.request.env["helpdesk.ticket.team"]
.sudo()
Expand Down
48 changes: 25 additions & 23 deletions helpdesk_mgmt/tests/test_helpdesk_portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from odoo.addons.base.tests.common import HttpCaseWithUserPortal


class TestHelpdeskPortal(HttpCaseWithUserPortal):
class TestHelpdeskPortalBase(HttpCaseWithUserPortal):
"""Test controllers defined for portal mode.
This is mostly for basic coverage; we don't go as far as fully validating
HTML produced by our routes.
Expand Down Expand Up @@ -39,18 +39,32 @@ def setUp(self):
def get_new_tickets(self, user):
return self.env["helpdesk.ticket"].with_user(user).search([])

def _submit_ticket(self):
resp = self.url_open(
"/submitted/ticket",
data={
"category": self.env.ref("helpdesk_mgmt.helpdesk_category_1").id,
"csrf_token": http.WebRequest.csrf_token(self),
"subject": self.new_ticket_title,
"description": "\n".join(self.new_ticket_desc_lines),
},
)
def _create_ticket(self, partner, ticket_title, **values):
"""Create a ticket submitted by the specified partner."""
data = {
"name": ticket_title,
"description": "test-description",
"partner_id": partner.id,
"partner_email": partner.email,
"partner_name": partner.name,
}
data.update(**values)
return self.env["helpdesk.ticket"].create(data)

def _submit_ticket(self, **values):
data = {
"category": self.env.ref("helpdesk_mgmt.helpdesk_category_1").id,
"csrf_token": http.WebRequest.csrf_token(self),
"subject": self.new_ticket_title,
"description": "\n".join(self.new_ticket_desc_lines),
}
data.update(**values)
resp = self.url_open("/submitted/ticket", data=data)

self.assertEqual(resp.status_code, 200)


class TestHelpdeskPortal(TestHelpdeskPortalBase):
def test_submit_ticket_01(self):
self.authenticate("test-basic-user", "test-basic-user")
self._submit_ticket()
Expand Down Expand Up @@ -192,15 +206,3 @@ def _call_close_ticket(self, ticket, stage):
self.assertTrue(resp.is_redirect) # http://127.0.0.1:8069/my/ticket/<ticket-id>
self.assertTrue(resp.headers["Location"].endswith(f"/my/ticket/{ticket.id}"))
return resp

def _create_ticket(self, partner, ticket_title):
"""Create a ticket submitted by the specified partner."""
return self.env["helpdesk.ticket"].create(
{
"name": ticket_title,
"description": "test-description",
"partner_id": partner.id,
"partner_email": partner.email,
"partner_name": partner.name,
}
)
118 changes: 118 additions & 0 deletions helpdesk_mgmt_timesheet/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
=========================
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/14.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-14-0/helpdesk-14-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/14.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 <https://github.com/OCA/helpdesk/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 <https://github.com/OCA/helpdesk/issues/new?body=module:%20helpdesk_mgmt_timesheet%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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 <https://www.aresoltec.com>`_:

* Inma Sánchez

* `SDi Soluciones, S.L. <https://www.sdi.es>`_:

* Oscar Soto
* Jorge Luis Quinteros

* `Punt Sistemes, S.L. <https://www.puntsistemes.es/>`_:

* Carlos Ramos

* `Solvos Consultoría Informática, S.L. <https://www.solvos.es/>`_:

* David Alonso

* `Guadaltech Soluciones Tecnológicas, S.L. <https://www.guadaltech.es/>`_:

* Fernando La Chica <[email protected]>

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 <https://github.com/OCA/helpdesk/tree/14.0/helpdesk_mgmt_timesheet>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions helpdesk_mgmt_timesheet/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
###############################################################################
# For copyright and license notices, see __manifest__.py file in root directory
###############################################################################
from . import models
32 changes: 32 additions & 0 deletions helpdesk_mgmt_timesheet/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright (C) 2020 Aresoltec Canarias <www.aresoltec.com>
# Copyright (C) 2020 Punt Sistemes <www.puntsistemes.es.es>
# Copyright (C) 2020 SDi Soluciones Digitales <www.sdi.es>
# Copyright (C) 2020 Solvos Consultoría Informática <www.solvos.es>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Helpdesk Ticket Timesheet",
"summary": "Add HR Timesheet to the tickets for Helpdesk Management.",
"author": "Aresoltec Canarias, "
"Punt Sistemes, "
"SDi Soluciones Digitales, "
"Solvos, "
"Odoo Community Association (OCA)",
"website": "https://github.com/OCA/helpdesk",
"license": "AGPL-3",
"category": "After-Sales",
"version": "15.0.1.0.0",
"depends": [
"helpdesk_mgmt_project",
"hr_timesheet",
"project_timesheet_time_control",
],
"data": [
"views/helpdesk_team_view.xml",
"views/helpdesk_ticket_view.xml",
"views/hr_timesheet_view.xml",
"views/helpdesk_project_task_view.xml",
"report/report_timesheet_templates.xml",
],
"demo": ["demo/helpdesk_mgmt_timesheet_demo.xml"],
}
36 changes: 36 additions & 0 deletions helpdesk_mgmt_timesheet/demo/helpdesk_mgmt_timesheet_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
vincent-hatakeyama marked this conversation as resolved.
Show resolved Hide resolved
<record id="project_1" model="project.project">
<field name="name">Helpdesk general project</field>
</record>
<record id="project_task_1" model="project.task">
<field name="name">Helpdesk general task</field>
<field name="project_id" ref="project_1" />
</record>
<record id="helpdesk_mgmt.helpdesk_team_2" model="helpdesk.ticket.team">
<field name="allow_timesheet" eval="True" />
<field name="default_project_id" ref="project_1" />
</record>
<record id="helpdesk_mgmt.helpdesk_ticket_1" model="helpdesk.ticket">
<field name="team_id" ref="helpdesk_mgmt.helpdesk_team_2" />
<field name="project_id" ref="project_1" />
<field name="task_id" ref="project_task_1" />
<field name="planned_hours" eval="5" />
</record>
<record id="helpdesk_ticket_1_timesheet_1" model="account.analytic.line">
<field name="ticket_id" ref="helpdesk_mgmt.helpdesk_ticket_1" />
<field name="name">Initial analysis</field>
<field name="user_id" ref='base.user_admin' />
<field name="project_id" ref="project_1" />
<field name="task_id" ref="project_task_1" />
<field name="unit_amount" eval="2.5" />
</record>
<record id="helpdesk_ticket_1_timesheet_2" model="account.analytic.line">
<field name="ticket_id" ref="helpdesk_mgmt.helpdesk_ticket_1" />
<field name="name">Resolution</field>
<field name="user_id" ref='base.user_admin' />
<field name="project_id" ref="project_1" />
<field name="task_id" ref="project_task_1" />
<field name="unit_amount" eval="2" />
</record>
</odoo>
Loading
Loading