Skip to content

Commit 8a67c45

Browse files
committed
[ADD] helpdesk_mgmt_ticket_invoice
1 parent c8d4614 commit 8a67c45

14 files changed

Lines changed: 709 additions & 0 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
============================
2+
Helpdesk Mgmt Ticket Invoice
3+
============================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:40f0fc93c0baedde52fa3f569c1f4830a9fedcf91563306d98e53ddff526f631
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-solvosci%2Fslv--helpdesk-lightgray.png?logo=github
20+
:target: https://github.com/solvosci/slv-helpdesk/tree/13.0/helpdesk_mgmt_ticket_invoice
21+
:alt: solvosci/slv-helpdesk
22+
23+
|badge1| |badge2| |badge3|
24+
25+
Adds relation between tickets and invoices
26+
27+
**Table of contents**
28+
29+
.. contents::
30+
:local:
31+
32+
Bug Tracker
33+
===========
34+
35+
Bugs are tracked on `GitHub Issues <https://github.com/solvosci/slv-helpdesk/issues>`_.
36+
In case of trouble, please check there if your issue has already been reported.
37+
If you spotted it first, help us to smash it by providing a detailed and welcomed
38+
`feedback <https://github.com/solvosci/slv-helpdesk/issues/new?body=module:%20helpdesk_mgmt_ticket_invoice%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
39+
40+
Do not contact contributors directly about support or help with technical issues.
41+
42+
Credits
43+
=======
44+
45+
Authors
46+
~~~~~~~
47+
48+
* Solvos
49+
50+
Contributors
51+
~~~~~~~~~~~~
52+
53+
* Iria Alonso <iria.alonso@solvos.es>
54+
55+
Maintainers
56+
~~~~~~~~~~~
57+
58+
This module is part of the `solvosci/slv-helpdesk <https://github.com/solvosci/slv-helpdesk/tree/13.0/helpdesk_mgmt_ticket_invoice>`_ project on GitHub.
59+
60+
You are welcome to contribute.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# © 2024 Solvos Consultoría Informática (<http://www.solvos.es>)
2+
# License AGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html
3+
{
4+
"name": "Helpdesk Mgmt Ticket Invoice",
5+
"summary": """
6+
Adds relation between tickets and invoices
7+
""",
8+
"author": "Solvos",
9+
"license": "AGPL-3",
10+
"version": "13.0.1.0.0",
11+
"category": "Uncategorized",
12+
"website": "https://github.com/solvosci/slv-helpdesk",
13+
"depends": [
14+
"helpdesk_mgmt",
15+
"account",
16+
],
17+
"data": [
18+
"views/account_move_view.xml",
19+
"views/helpdesk_ticket_view.xml",
20+
],
21+
'installable': True,
22+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * helpdesk_mgmt_ticket_invoice
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 13.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2024-09-26 09:36+0000\n"
10+
"PO-Revision-Date: 2024-09-26 09:36+0000\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: \n"
17+
18+
#. module: helpdesk_mgmt_ticket_invoice
19+
#: model:ir.model.fields,field_description:helpdesk_mgmt_ticket_invoice.field_account_move__count_ticket_ids
20+
msgid "Count Ticket"
21+
msgstr ""
22+
23+
#. module: helpdesk_mgmt_ticket_invoice
24+
#: model_terms:ir.ui.view,arch_db:helpdesk_mgmt_ticket_invoice.account_move_form_view
25+
msgid "Create ticket"
26+
msgstr "Crear ticket"
27+
28+
#. module: helpdesk_mgmt_ticket_invoice
29+
#: model:ir.actions.act_window,name:helpdesk_mgmt_ticket_invoice.helpdesk_ticket_action_form
30+
#: model:ir.model,name:helpdesk_mgmt_ticket_invoice.model_helpdesk_ticket
31+
msgid "Helpdesk Ticket"
32+
msgstr "Ticket Helpdesk"
33+
34+
#. module: helpdesk_mgmt_ticket_invoice
35+
#: model:ir.model.fields,field_description:helpdesk_mgmt_ticket_invoice.field_helpdesk_ticket__invoice_id
36+
msgid "Invoice"
37+
msgstr "Factura"
38+
39+
#. module: helpdesk_mgmt_ticket_invoice
40+
#: model:ir.model,name:helpdesk_mgmt_ticket_invoice.model_account_move
41+
msgid "Journal Entries"
42+
msgstr "Asientos contables"
43+
44+
#. module: helpdesk_mgmt_ticket_invoice
45+
#: model:ir.model.fields,field_description:helpdesk_mgmt_ticket_invoice.field_account_move__ticket_ids
46+
msgid "Ticket"
47+
msgstr ""
48+
49+
#. module: helpdesk_mgmt_ticket_invoice
50+
#: model_terms:ir.ui.view,arch_db:helpdesk_mgmt_ticket_invoice.account_move_form_view
51+
msgid "Tickets"
52+
msgstr ""
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * helpdesk_mgmt_ticket_invoice
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 13.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2024-09-26 09:36+0000\n"
10+
"PO-Revision-Date: 2024-09-26 09:36+0000\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: \n"
17+
18+
#. module: helpdesk_mgmt_ticket_invoice
19+
#: model:ir.model.fields,field_description:helpdesk_mgmt_ticket_invoice.field_account_move__count_ticket_ids
20+
msgid "Count Ticket"
21+
msgstr ""
22+
23+
#. module: helpdesk_mgmt_ticket_invoice
24+
#: model_terms:ir.ui.view,arch_db:helpdesk_mgmt_ticket_invoice.account_move_form_view
25+
msgid "Create ticket"
26+
msgstr ""
27+
28+
#. module: helpdesk_mgmt_ticket_invoice
29+
#: model:ir.actions.act_window,name:helpdesk_mgmt_ticket_invoice.helpdesk_ticket_action_form
30+
#: model:ir.model,name:helpdesk_mgmt_ticket_invoice.model_helpdesk_ticket
31+
msgid "Helpdesk Ticket"
32+
msgstr ""
33+
34+
#. module: helpdesk_mgmt_ticket_invoice
35+
#: model:ir.model.fields,field_description:helpdesk_mgmt_ticket_invoice.field_helpdesk_ticket__invoice_id
36+
msgid "Invoice"
37+
msgstr ""
38+
39+
#. module: helpdesk_mgmt_ticket_invoice
40+
#: model:ir.model,name:helpdesk_mgmt_ticket_invoice.model_account_move
41+
msgid "Journal Entries"
42+
msgstr ""
43+
44+
#. module: helpdesk_mgmt_ticket_invoice
45+
#: model:ir.model.fields,field_description:helpdesk_mgmt_ticket_invoice.field_account_move__ticket_ids
46+
msgid "Ticket"
47+
msgstr ""
48+
49+
#. module: helpdesk_mgmt_ticket_invoice
50+
#: model_terms:ir.ui.view,arch_db:helpdesk_mgmt_ticket_invoice.account_move_form_view
51+
msgid "Tickets"
52+
msgstr ""
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import account_move
2+
from . import helpdesk_ticket
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# © 2024 Solvos Consultoría Informática (<http://www.solvos.es>)
2+
# License AGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html
3+
4+
from odoo import fields, models
5+
6+
7+
class AccountMove(models.Model):
8+
_inherit = "account.move"
9+
10+
ticket_ids = fields.Many2many("helpdesk.ticket")
11+
count_ticket_ids = fields.Integer(compute="_compute_count_ticket_ids")
12+
13+
def _compute_count_ticket_ids(self):
14+
for record in self:
15+
record.count_ticket_ids = self.env["helpdesk.ticket"].search_count([("invoice_id", "=", record.id)])
16+
17+
def action_view_tickets(self):
18+
ticket = self.env['helpdesk.ticket'].search([('invoice_id', "=", self.id)])
19+
action = {
20+
'name': 'Tickets',
21+
'res_model': 'helpdesk.ticket',
22+
'type': 'ir.actions.act_window',
23+
}
24+
if self.count_ticket_ids == 1:
25+
action['view_mode'] = 'form'
26+
action['res_id'] = ticket.id
27+
else:
28+
action['view_mode'] = 'tree,form'
29+
action['domain'] = [('invoice_id', "=", self.id)]
30+
return action
31+
32+
def create_ticket(self):
33+
action = self.env.ref("helpdesk_mgmt_ticket_invoice.helpdesk_ticket_action_form").read()[0]
34+
action['context'] = {
35+
'default_partner_id': self.partner_id.id,
36+
'default_ticket_invoice_id': self.id
37+
}
38+
39+
return action
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# © 2024 Solvos Consultoría Informática (<http://www.solvos.es>)
2+
# License AGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html
3+
4+
from odoo import fields, models
5+
6+
7+
class HelpdeskTicket(models.Model):
8+
_inherit = "helpdesk.ticket"
9+
10+
invoice_id = fields.Many2one("account.move")
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* Iria Alonso <iria.alonso@solvos.es>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Adds relation between tickets and invoices

0 commit comments

Comments
 (0)