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

[17.0][MIG] helpdesk_mgmt_sale: Migration to 17.0 #682

Merged
merged 7 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
94 changes: 94 additions & 0 deletions helpdesk_mgmt_sale/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
===================
Helpdesk Sale Order
===================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9058b48ff43b86b6c8dd426fccf2d6ccf02d75989c508e82bee02b5bfe550bcf
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Production/Stable
.. |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/17.0/helpdesk_mgmt_sale
:alt: OCA/helpdesk
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/helpdesk-17-0/helpdesk-17-0-helpdesk_mgmt_sale
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/helpdesk&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module extends the Helpdesk functionality in Odoo to allow an
integration between Helpdesk tickets and sales orders. A ticket can have
several sales orders associated with it, which in turn will have the
ticket associated with it, allowing tickets and sales to be related.

**Table of contents**

.. contents::
:local:

Usage
=====

To associate orders to Helpdesk tickets:

1. Create or modify a Helpdesk ticket.
2. In the ticket view, you will find a **Sales Order** Smartbutton which
will show the number of orders associated to the ticket.
3. Clicking on the Smartbutton will open a view with all the sales
orders related to the current ticket.
4. To create an order associated to the ticket click on the **Create**
button.

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 to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/helpdesk/issues/new?body=module:%20helpdesk_mgmt_sale%0Aversion:%2017.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
-------

* Tecnativa

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

- `Tecnativa <https://www.tecnativa.com>`__:

- Pilar Vargas

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/17.0/helpdesk_mgmt_sale>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions helpdesk_mgmt_sale/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
18 changes: 18 additions & 0 deletions helpdesk_mgmt_sale/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2024 Tecnativa - Pilar Vargas
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Helpdesk Sale Order",
"summary": "Add the option to select project in the sale orders.",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"category": "Sales Management",
"author": "Tecnativa," "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/helpdesk",
"depends": ["helpdesk_mgmt", "sale"],
"data": [
"views/helpdesk_ticket_views.xml",
"views/sale_order_views.xml",
],
"development_status": "Production/Stable",
"auto_install": True,
}
63 changes: 63 additions & 0 deletions helpdesk_mgmt_sale/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * helpdesk_mgmt_sale
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-09-23 10:06+0000\n"
"Last-Translator: Pilar Vargas <pilar.vargas@tecnativa.com>\n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.6.2\n"

#. module: helpdesk_mgmt_sale
#: model_terms:ir.ui.view,arch_db:helpdesk_mgmt_sale.view_order_form
msgid "Helpdesk"
msgstr "Servicio de asistencia"

#. module: helpdesk_mgmt_sale
#: model:ir.model,name:helpdesk_mgmt_sale.model_helpdesk_ticket
msgid "Helpdesk Ticket"
msgstr "Solicitud de servicio de asistencia"

#. module: helpdesk_mgmt_sale
#: model:ir.model.fields,field_description:helpdesk_mgmt_sale.field_helpdesk_ticket__sale_order_ids
msgid "Sale Order"
msgstr "Pedido de venta"

#. module: helpdesk_mgmt_sale
#: model:ir.model.fields,field_description:helpdesk_mgmt_sale.field_helpdesk_ticket__so_count
msgid "Sale Order Count"
msgstr "Nº de pedidos de venta"

#. module: helpdesk_mgmt_sale
#: model_terms:ir.ui.view,arch_db:helpdesk_mgmt_sale.ticket_view_form
msgid "Sale Orders"
msgstr "Pedidos"

#. module: helpdesk_mgmt_sale
#: model:ir.model,name:helpdesk_mgmt_sale.model_sale_order
msgid "Sales Order"
msgstr "Pedidos"

#. module: helpdesk_mgmt_sale
#: model:ir.model.fields,field_description:helpdesk_mgmt_sale.field_sale_order__ticket_ids
msgid "Ticket"
msgstr "Solicitud"

#. module: helpdesk_mgmt_sale
#: model:ir.actions.act_window,name:helpdesk_mgmt_sale.action_helpdesk_ticket
#: model_terms:ir.ui.view,arch_db:helpdesk_mgmt_sale.view_order_form
msgid "Tickets"
msgstr ""

#. module: helpdesk_mgmt_sale
#: model:ir.model.fields,field_description:helpdesk_mgmt_sale.field_sale_order__ticket_count
msgid "Tickets Count"
msgstr ""
60 changes: 60 additions & 0 deletions helpdesk_mgmt_sale/i18n/helpdesk_mgmt_sale.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * helpdesk_mgmt_sale
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: helpdesk_mgmt_sale
#: model_terms:ir.ui.view,arch_db:helpdesk_mgmt_sale.view_order_form
msgid "Helpdesk"
msgstr ""

#. module: helpdesk_mgmt_sale
#: model:ir.model,name:helpdesk_mgmt_sale.model_helpdesk_ticket
msgid "Helpdesk Ticket"
msgstr ""

#. module: helpdesk_mgmt_sale
#: model:ir.model.fields,field_description:helpdesk_mgmt_sale.field_helpdesk_ticket__sale_order_ids
msgid "Sale Order"
msgstr ""

#. module: helpdesk_mgmt_sale
#: model:ir.model.fields,field_description:helpdesk_mgmt_sale.field_helpdesk_ticket__so_count
msgid "Sale Order Count"
msgstr ""

#. module: helpdesk_mgmt_sale
#: model_terms:ir.ui.view,arch_db:helpdesk_mgmt_sale.ticket_view_form
msgid "Sale Orders"
msgstr ""

#. module: helpdesk_mgmt_sale
#: model:ir.model,name:helpdesk_mgmt_sale.model_sale_order
msgid "Sales Order"
msgstr ""

#. module: helpdesk_mgmt_sale
#: model:ir.model.fields,field_description:helpdesk_mgmt_sale.field_sale_order__ticket_ids
msgid "Ticket"
msgstr ""

#. module: helpdesk_mgmt_sale
#: model:ir.actions.act_window,name:helpdesk_mgmt_sale.action_helpdesk_ticket
#: model_terms:ir.ui.view,arch_db:helpdesk_mgmt_sale.view_order_form
msgid "Tickets"
msgstr ""

#. module: helpdesk_mgmt_sale
#: model:ir.model.fields,field_description:helpdesk_mgmt_sale.field_sale_order__ticket_count
msgid "Tickets Count"
msgstr ""
2 changes: 2 additions & 0 deletions helpdesk_mgmt_sale/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import helpdesk_ticket
from . import sale_order
25 changes: 25 additions & 0 deletions helpdesk_mgmt_sale/models/helpdesk_ticket.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from odoo import api, fields, models


class HelpdeskTicket(models.Model):
_inherit = "helpdesk.ticket"

sale_order_ids = fields.Many2many("sale.order")
so_count = fields.Integer(
string="Sale Order Count", compute="_compute_so_count", store=True
)

@api.depends("sale_order_ids")
def _compute_so_count(self):
for ticket in self:
ticket.so_count = len(ticket.sale_order_ids)

def action_view_sale_orders(self):
"""Returns action to view sale orders related to this ticket."""
action = self.env["ir.actions.actions"]._for_xml_id("sale.action_orders")
action["domain"] = [("ticket_ids", "in", [self.id])]
action["context"] = {
"default_ticket_ids": [(4, [self.id])],
"default_partner_id": self.partner_id.id,
}
return action
15 changes: 15 additions & 0 deletions helpdesk_mgmt_sale/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from odoo import api, fields, models


class SaleOrder(models.Model):
_inherit = "sale.order"

ticket_ids = fields.Many2many("helpdesk.ticket")
ticket_count = fields.Integer(
string="Tickets Count", compute="_compute_ticket_count", store=True
)

@api.depends("ticket_ids")
def _compute_ticket_count(self):
for order in self:
order.ticket_count = len(order.ticket_ids)
3 changes: 3 additions & 0 deletions helpdesk_mgmt_sale/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions helpdesk_mgmt_sale/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- [Tecnativa](https://www.tecnativa.com):
- Pilar Vargas
4 changes: 4 additions & 0 deletions helpdesk_mgmt_sale/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This module extends the Helpdesk functionality in Odoo to allow an
integration between Helpdesk tickets and sales orders. A ticket can have
several sales orders associated with it, which in turn will have the
ticket associated with it, allowing tickets and sales to be related.
9 changes: 9 additions & 0 deletions helpdesk_mgmt_sale/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
To associate orders to Helpdesk tickets:

1. Create or modify a Helpdesk ticket.
2. In the ticket view, you will find a **Sales Order** Smartbutton
which will show the number of orders associated to the ticket.
3. Clicking on the Smartbutton will open a view with all the sales
orders related to the current ticket.
4. To create an order associated to the ticket click on the **Create**
button.
Binary file added helpdesk_mgmt_sale/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading