Skip to content

Commit

Permalink
Merge PR #628 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Sep 20, 2024
2 parents 222fe21 + 74dddcc commit daa6d2d
Show file tree
Hide file tree
Showing 18 changed files with 961 additions and 0 deletions.
88 changes: 88 additions & 0 deletions helpdesk_mgmt_sale/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
===================
Helpdesk Sale Order
===================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:5d0720d9a8524713cedc3cb1665d48b3783019ef5183e22e33eb722fb73f3808
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/15.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-15-0/helpdesk-15-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=15.0
:alt: Try me on Runboat

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

This module extends the Helpdesk functionality in Odoo to allow 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:

#. Create or modify a Helpdesk ticket.
#. In the ticket view, you will find a **Sales Order** Smartbutton which will show the number of orders associated to the ticket.
#. Clicking on the Smartbutton will open a view with all the sales orders related to the current ticket.
#. 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:%2015.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/15.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": "15.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": "Beta",
"auto_install": True,
}
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.One2many("sale.order", "ticket_id")
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_id", "=", self.id)]
action["context"] = {
"default_ticket_id": self.id,
"default_partner_id": self.partner_id.id,
}
return action
7 changes: 7 additions & 0 deletions helpdesk_mgmt_sale/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from odoo import fields, models


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

ticket_id = fields.Many2one("helpdesk.ticket")
3 changes: 3 additions & 0 deletions helpdesk_mgmt_sale/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* `Tecnativa <https://www.tecnativa.com>`_:

* Pilar Vargas
4 changes: 4 additions & 0 deletions helpdesk_mgmt_sale/readme/DESCRIPTION.rst
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.
6 changes: 6 additions & 0 deletions helpdesk_mgmt_sale/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
To associate orders to Helpdesk tickets:

#. Create or modify a Helpdesk ticket.
#. In the ticket view, you will find a **Sales Order** Smartbutton which will show the number of orders associated to the ticket.
#. Clicking on the Smartbutton will open a view with all the sales orders related to the current ticket.
#. 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

0 comments on commit daa6d2d

Please sign in to comment.