Skip to content

Commit

Permalink
Merge PR #25 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by andhit-r
  • Loading branch information
ssi-bot committed Sep 6, 2023
2 parents 9d86b1e + 5d9b958 commit 9abf32f
Show file tree
Hide file tree
Showing 7 changed files with 178 additions and 0 deletions.
46 changes: 46 additions & 0 deletions ssi_helpdesk_appointment/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

==============================
Helpdesk - Project Integration
==============================


Installation
============

To install this module, you need to:

1. Clone the branch 14.0 of the repository https://github.com/open-synergy/ssi-helpdesk
2. Add the path to this repository in your configuration (addons-path)
3. Update the module list (Must be on developer mode)
4. Go to menu *Apps -> Apps -> Main Apps*
5. Search For *Helpdesk - Project Integration*
6. Install the module

Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/open-synergy/ssi-helpdesk/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.


Credits
=======

Contributors
------------

* Andhitia Rama <[email protected]>

Maintainer
----------

.. image:: https://simetri-sinergi.id/logo.png
:alt: PT. Simetri Sinergi Indonesia
:target: https://simetri-sinergi.id

This module is maintained by the PT. Simetri Sinergi Indonesia.
7 changes: 7 additions & 0 deletions ssi_helpdesk_appointment/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright 2022 OpenSynergy Indonesia
# Copyright 2022 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0-standalone.html).

from . import (
models,
)
20 changes: 20 additions & 0 deletions ssi_helpdesk_appointment/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2022 OpenSynergy Indonesia
# Copyright 2022 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0-standalone.html).
{
"name": "Helpdesk - Appointment Integration",
"version": "14.0.1.0.0",
"website": "https://simetri-sinergi.id",
"author": "OpenSynergy Indonesia, PT. Simetri Sinergi Indonesia",
"license": "AGPL-3",
"installable": True,
"depends": [
"ssi_helpdesk",
"ssi_appointment_request",
],
"data": [
"views/helpdesk_ticket_views.xml",
],
"demo": [],
"images": [],
}
7 changes: 7 additions & 0 deletions ssi_helpdesk_appointment/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright 2022 OpenSynergy Indonesia
# Copyright 2022 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0-standalone.html).

from . import (
helpdesk_ticket,
)
50 changes: 50 additions & 0 deletions ssi_helpdesk_appointment/models/helpdesk_ticket.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Copyright 2022 OpenSynergy Indonesia
# Copyright 2022 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0-standalone.html).

from odoo import api, fields, models


class HelpdeskTicket(models.Model):
_name = "helpdesk_ticket"
_inherit = [
"helpdesk_ticket",
]

appointment_schedule_ids = fields.Many2many(
string="Appointment Requests",
comodel_name="appointment_request",
relation="rel_helpdesk_ticket_2_appointment_request",
column1="ticket_id",
column2="request_id",
)
appointment_request_state = fields.Selection(
string="Appointment Request Status",
selection=[
("no_need", "Not Needed"),
("open", "In Progress"),
("done", "Done"),
],
compute="_compute_appointment_request_state",
store=True,
)

@api.depends(
"appointment_schedule_ids",
"appointment_schedule_ids.appointment_id.state",
)
def _compute_appointment_request_state(self):
for record in self:
result = "no_need"

count_req = len(record.appointment_schedule_ids)

if count_req > 0:
result = "done"
for req in record.appointment_schedule_ids:
if not req.appointment_id:
result = "open"
elif req.appointment_id.state != "done":
result = "open"

record.appointment_request_state = result
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions ssi_helpdesk_appointment/views/helpdesk_ticket_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2022 OpenSynergy Indonesia
Copyright 2022 PT. Simetri Sinergi Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>

<record id="helpdesk_ticket_view_search" model="ir.ui.view">
<field name="name">helpdesk_ticket - search</field>
<field name="model">helpdesk_ticket</field>
<field name="inherit_id" ref="ssi_helpdesk.helpdesk_ticket_view_search" />
<field name="arch" type="xml">
<data>
<xpath expr="//separator[@name='activity']" position="before">
<separator name="appointment" />
<filter
name="not_done_appointment"
string="Appointment Not Done"
domain="[('appointment_request_state','=',False)]"
/>
<filter
name="done_appointment"
string="Appointment Done"
domain="[('appointment_request_state','=',True)]"
/>
</xpath>
</data>
</field>
</record>

<record id="helpdesk_ticket_view_form" model="ir.ui.view">
<field name="name">helpdesk_ticket form</field>
<field name="model">helpdesk_ticket</field>
<field name="inherit_id" ref="ssi_helpdesk.helpdesk_ticket_view_form" />
<field name="mode">extension</field>
<field name="arch" type="xml">
<data>
<xpath expr="//page[1]" position="after">
<page name="appointment" string="Appointments">
<group name="appointment" colspan="4" col="2">
<field name="appointment_request_state" />
</group>
<field name="appointment_schedule_ids" />
</page>
</xpath>
</data>
</field>
</record>
</odoo>

0 comments on commit 9abf32f

Please sign in to comment.