From dfbdb2756bfcae7952e296cf0f36f6b1df478fef Mon Sep 17 00:00:00 2001 From: pilarvargas-tecnativa Date: Thu, 19 Sep 2024 16:30:13 +0200 Subject: [PATCH 1/7] [ADD] helpdesk_mgmt_sale: Add new module TT50683 --- helpdesk_mgmt_sale/README.rst | 88 ++++ helpdesk_mgmt_sale/__init__.py | 1 + helpdesk_mgmt_sale/__manifest__.py | 18 + helpdesk_mgmt_sale/models/__init__.py | 2 + helpdesk_mgmt_sale/models/helpdesk_ticket.py | 25 + helpdesk_mgmt_sale/models/sale_order.py | 7 + helpdesk_mgmt_sale/readme/CONTRIBUTORS.rst | 3 + helpdesk_mgmt_sale/readme/DESCRIPTION.rst | 4 + helpdesk_mgmt_sale/readme/USAGE.rst | 6 + .../static/description/icon.png | Bin 0 -> 14071 bytes .../static/description/icon.svg | 267 +++++++++++ .../static/description/index.html | 434 ++++++++++++++++++ helpdesk_mgmt_sale/tests/__init__.py | 1 + .../tests/test_helpdesk_ticket.py | 53 +++ .../views/helpdesk_ticket_views.xml | 25 + helpdesk_mgmt_sale/views/sale_order_views.xml | 20 + 16 files changed, 954 insertions(+) create mode 100644 helpdesk_mgmt_sale/README.rst create mode 100644 helpdesk_mgmt_sale/__init__.py create mode 100644 helpdesk_mgmt_sale/__manifest__.py create mode 100644 helpdesk_mgmt_sale/models/__init__.py create mode 100644 helpdesk_mgmt_sale/models/helpdesk_ticket.py create mode 100644 helpdesk_mgmt_sale/models/sale_order.py create mode 100644 helpdesk_mgmt_sale/readme/CONTRIBUTORS.rst create mode 100644 helpdesk_mgmt_sale/readme/DESCRIPTION.rst create mode 100644 helpdesk_mgmt_sale/readme/USAGE.rst create mode 100644 helpdesk_mgmt_sale/static/description/icon.png create mode 100644 helpdesk_mgmt_sale/static/description/icon.svg create mode 100644 helpdesk_mgmt_sale/static/description/index.html create mode 100644 helpdesk_mgmt_sale/tests/__init__.py create mode 100644 helpdesk_mgmt_sale/tests/test_helpdesk_ticket.py create mode 100644 helpdesk_mgmt_sale/views/helpdesk_ticket_views.xml create mode 100644 helpdesk_mgmt_sale/views/sale_order_views.xml diff --git a/helpdesk_mgmt_sale/README.rst b/helpdesk_mgmt_sale/README.rst new file mode 100644 index 0000000000..190be50533 --- /dev/null +++ b/helpdesk_mgmt_sale/README.rst @@ -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 `_. +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* `Tecnativa `_: + + * 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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/helpdesk_mgmt_sale/__init__.py b/helpdesk_mgmt_sale/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/helpdesk_mgmt_sale/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/helpdesk_mgmt_sale/__manifest__.py b/helpdesk_mgmt_sale/__manifest__.py new file mode 100644 index 0000000000..c774c6c2c1 --- /dev/null +++ b/helpdesk_mgmt_sale/__manifest__.py @@ -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, +} diff --git a/helpdesk_mgmt_sale/models/__init__.py b/helpdesk_mgmt_sale/models/__init__.py new file mode 100644 index 0000000000..18f415b1c0 --- /dev/null +++ b/helpdesk_mgmt_sale/models/__init__.py @@ -0,0 +1,2 @@ +from . import helpdesk_ticket +from . import sale_order diff --git a/helpdesk_mgmt_sale/models/helpdesk_ticket.py b/helpdesk_mgmt_sale/models/helpdesk_ticket.py new file mode 100644 index 0000000000..f88ccc68e6 --- /dev/null +++ b/helpdesk_mgmt_sale/models/helpdesk_ticket.py @@ -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 diff --git a/helpdesk_mgmt_sale/models/sale_order.py b/helpdesk_mgmt_sale/models/sale_order.py new file mode 100644 index 0000000000..56424d3461 --- /dev/null +++ b/helpdesk_mgmt_sale/models/sale_order.py @@ -0,0 +1,7 @@ +from odoo import fields, models + + +class SaleOrder(models.Model): + _inherit = "sale.order" + + ticket_id = fields.Many2one("helpdesk.ticket") diff --git a/helpdesk_mgmt_sale/readme/CONTRIBUTORS.rst b/helpdesk_mgmt_sale/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..44075b9f25 --- /dev/null +++ b/helpdesk_mgmt_sale/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* `Tecnativa `_: + + * Pilar Vargas diff --git a/helpdesk_mgmt_sale/readme/DESCRIPTION.rst b/helpdesk_mgmt_sale/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..af71e8d0c7 --- /dev/null +++ b/helpdesk_mgmt_sale/readme/DESCRIPTION.rst @@ -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. diff --git a/helpdesk_mgmt_sale/readme/USAGE.rst b/helpdesk_mgmt_sale/readme/USAGE.rst new file mode 100644 index 0000000000..2628bcdec6 --- /dev/null +++ b/helpdesk_mgmt_sale/readme/USAGE.rst @@ -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. diff --git a/helpdesk_mgmt_sale/static/description/icon.png b/helpdesk_mgmt_sale/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..f3748245b10e9f4dcf1b0a75ba53ef6e934184f5 GIT binary patch literal 14071 zcmW+-15{>R8?DKs&~Dudk>%UVDEh*l@ufq zU~yqVKtK?rrNmT#&-Z`7(2&62h|3=Wzz4XCh_o6s@Z$?@8UX@A3?eNitmc`0mE+;6 zyW)4!^U_t3j$_E2E(`@pKpY{0T5X6GO+K&Tl-TLMf63e7URd48!$X7jE9a8(cjNYI zJ;BRp{SoN~ZGoBgPq8R;pBoT3?;AH*$c3FPA+7#zhJ^oRc-BIG}liZ!s{pwV(ZY{M!?tAd+eZkZ3%?iAqYnGWnlAAjAfr*Y##3vo`5{ zEF*@@=!hiWP+F}S!QWY!6WOpMVM_3i`iYLd*U4JzV8csX68GB2{kK}e8PaDsh$s`8 zW8!lRFHtDU#-mhT%oz;)6CDH2$&5J_MD7%R81+B-4IEkAII>k`gUJkd-2I2}(*o5i z5n}Ar_3HA0kZG-X(-OR~%*^Z#Hl6vkll+!-iSlBJArM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c03&&C0ol+u5es}|4^GIOOj0+6AOZcx|JC#5>O<5E z+)pBh>`Fa0tuw{QU||di?PBV#yBgfW0vd;tDA`x~ITB=S3P$pcu?aws60Z|l5KSYd=N5q7>qC#1Y%|H&7TV_PL3JZ(=RA+)(?K6TA4`TCL4&f MxPn-Xh+)wG0P1HGa{vGU literal 0 HcmV?d00001 diff --git a/helpdesk_mgmt_sale/static/description/icon.svg b/helpdesk_mgmt_sale/static/description/icon.svg new file mode 100644 index 0000000000..911d657702 --- /dev/null +++ b/helpdesk_mgmt_sale/static/description/icon.svg @@ -0,0 +1,267 @@ + + + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/helpdesk_mgmt_sale/static/description/index.html b/helpdesk_mgmt_sale/static/description/index.html new file mode 100644 index 0000000000..4b444c4aca --- /dev/null +++ b/helpdesk_mgmt_sale/static/description/index.html @@ -0,0 +1,434 @@ + + + + + +Helpdesk Sale Order + + + +
+

Helpdesk Sale Order

+ + +

Beta License: AGPL-3 OCA/helpdesk Translate me on Weblate Try me on Runboat

+

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

+ +
+

Usage

+

To associate orders to Helpdesk tickets:

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

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Tecnativa
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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 project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/helpdesk_mgmt_sale/tests/__init__.py b/helpdesk_mgmt_sale/tests/__init__.py new file mode 100644 index 0000000000..5b420011e0 --- /dev/null +++ b/helpdesk_mgmt_sale/tests/__init__.py @@ -0,0 +1 @@ +from . import test_helpdesk_ticket diff --git a/helpdesk_mgmt_sale/tests/test_helpdesk_ticket.py b/helpdesk_mgmt_sale/tests/test_helpdesk_ticket.py new file mode 100644 index 0000000000..cbbc863110 --- /dev/null +++ b/helpdesk_mgmt_sale/tests/test_helpdesk_ticket.py @@ -0,0 +1,53 @@ +# Copyright (C) 2024 Tecnativa - Pilar Vargas +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo.tests.common import TransactionCase + + +class TestHelpdeskTicketSale(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.partner = cls.env["res.partner"].create( + {"name": "Test Partner", "email": "testpartner@example.com"} + ) + cls.ticket = cls.env["helpdesk.ticket"].create( + { + "name": "Test Helpdesk Ticket", + "partner_id": cls.partner.id, + "description": "Test Helpdesk Ticket", + } + ) + cls.sale_order_1 = cls.env["sale.order"].create( + { + "partner_id": cls.partner.id, + "ticket_id": cls.ticket.id, + } + ) + cls.sale_order_2 = cls.env["sale.order"].create( + { + "partner_id": cls.partner.id, + "ticket_id": cls.ticket.id, + } + ) + + def test_sale_orders_associated_with_ticket(self): + # Verify that a Helpdesk ticket has multiple sales orders associated with it. + self.assertEqual(len(self.ticket.sale_order_ids), 2) + self.assertIn(self.sale_order_1, self.ticket.sale_order_ids) + self.assertIn(self.sale_order_2, self.ticket.sale_order_ids) + + def test_partner_association_in_sale_order(self): + # Verify that a sales order is associated with the correct ticket partner. + self.assertEqual(self.sale_order_1.partner_id, self.partner) + self.assertEqual(self.sale_order_2.partner_id, self.partner) + + def test_smartbutton_sale_order_count(self): + # Check the sales order counter in the smartbutton of the ticket. + self.ticket._compute_so_count() + self.assertEqual(self.ticket.so_count, 2) + + def test_action_view_sale_orders(self): + # Verify that the smartbutton action displays the associated orders correctly. + action = self.ticket.action_view_sale_orders() + self.assertEqual(action["domain"], [("ticket_id", "=", self.ticket.id)]) + self.assertEqual(action["context"]["default_ticket_id"], self.ticket.id) diff --git a/helpdesk_mgmt_sale/views/helpdesk_ticket_views.xml b/helpdesk_mgmt_sale/views/helpdesk_ticket_views.xml new file mode 100644 index 0000000000..8ad5f9e9bd --- /dev/null +++ b/helpdesk_mgmt_sale/views/helpdesk_ticket_views.xml @@ -0,0 +1,25 @@ + + + + + helpdesk.ticket + + + + + + + + + diff --git a/helpdesk_mgmt_sale/views/sale_order_views.xml b/helpdesk_mgmt_sale/views/sale_order_views.xml new file mode 100644 index 0000000000..c209380afd --- /dev/null +++ b/helpdesk_mgmt_sale/views/sale_order_views.xml @@ -0,0 +1,20 @@ + + + + + sale.order + + + + + + + + + + + From c0867a86e1157284dc8e1aa191e6b5283cfba24e Mon Sep 17 00:00:00 2001 From: oca-ci Date: Fri, 20 Sep 2024 17:37:15 +0000 Subject: [PATCH 2/7] [UPD] Update helpdesk_mgmt_sale.pot [BOT] post-merge updates --- helpdesk_mgmt_sale/README.rst | 7 ++- .../i18n/helpdesk_mgmt_sale.pot | 49 +++++++++++++++++++ .../static/description/index.html | 18 ++++--- 3 files changed, 66 insertions(+), 8 deletions(-) create mode 100644 helpdesk_mgmt_sale/i18n/helpdesk_mgmt_sale.pot diff --git a/helpdesk_mgmt_sale/README.rst b/helpdesk_mgmt_sale/README.rst index 190be50533..41a09a0892 100644 --- a/helpdesk_mgmt_sale/README.rst +++ b/helpdesk_mgmt_sale/README.rst @@ -7,7 +7,7 @@ Helpdesk Sale Order !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:5d0720d9a8524713cedc3cb1665d48b3783019ef5183e22e33eb722fb73f3808 + !! source digest: sha256:01e1efa36c6e799c149291e34ff665ab891fb45fd2e9026b0f39a760c0bd4382 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png @@ -28,7 +28,10 @@ Helpdesk Sale Order |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. +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** diff --git a/helpdesk_mgmt_sale/i18n/helpdesk_mgmt_sale.pot b/helpdesk_mgmt_sale/i18n/helpdesk_mgmt_sale.pot new file mode 100644 index 0000000000..434e682fa1 --- /dev/null +++ b/helpdesk_mgmt_sale/i18n/helpdesk_mgmt_sale.pot @@ -0,0 +1,49 @@ +# 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_id +msgid "Ticket" +msgstr "" diff --git a/helpdesk_mgmt_sale/static/description/index.html b/helpdesk_mgmt_sale/static/description/index.html index 4b444c4aca..615a290a50 100644 --- a/helpdesk_mgmt_sale/static/description/index.html +++ b/helpdesk_mgmt_sale/static/description/index.html @@ -8,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -274,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -300,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -366,10 +367,13 @@

Helpdesk Sale Order

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:5d0720d9a8524713cedc3cb1665d48b3783019ef5183e22e33eb722fb73f3808 +!! source digest: sha256:01e1efa36c6e799c149291e34ff665ab891fb45fd2e9026b0f39a760c0bd4382 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/helpdesk Translate me on Weblate Try me on Runboat

-

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.

+

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

    @@ -421,7 +425,9 @@

    Contributors

    Maintainers

    This module is maintained by the OCA.

    -Odoo Community Association + +Odoo Community Association +

    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.

    From ce1872423ab5a1d112213ccabab5b9e712af9eda Mon Sep 17 00:00:00 2001 From: Pilar Vargas Date: Mon, 23 Sep 2024 07:22:56 +0000 Subject: [PATCH 3/7] Added translation using Weblate (Spanish) Translated using Weblate (Spanish) Currently translated at 100.0% (7 of 7 strings) Translation: helpdesk-15.0/helpdesk-15.0-helpdesk_mgmt_sale Translate-URL: https://translation.odoo-community.org/projects/helpdesk-15-0/helpdesk-15-0-helpdesk_mgmt_sale/es/ --- helpdesk_mgmt_sale/i18n/es.po | 52 +++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 helpdesk_mgmt_sale/i18n/es.po diff --git a/helpdesk_mgmt_sale/i18n/es.po b/helpdesk_mgmt_sale/i18n/es.po new file mode 100644 index 0000000000..fd89ccc1bc --- /dev/null +++ b/helpdesk_mgmt_sale/i18n/es.po @@ -0,0 +1,52 @@ +# 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 \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_id +msgid "Ticket" +msgstr "Solicitud" From 97c3cd623a3d825e4296b1430773c1832146e909 Mon Sep 17 00:00:00 2001 From: pilarvargas-tecnativa Date: Fri, 27 Sep 2024 16:14:47 +0200 Subject: [PATCH 4/7] [IMP] helpdesk_mgmt_sale: Allow to assign multiple tickets to an order TT50683 [UPD] Update helpdesk_mgmt_sale.pot [BOT] post-merge updates Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: helpdesk-15.0/helpdesk-15.0-helpdesk_mgmt_sale Translate-URL: https://translation.odoo-community.org/projects/helpdesk-15-0/helpdesk-15-0-helpdesk_mgmt_sale/ --- helpdesk_mgmt_sale/README.rst | 2 +- helpdesk_mgmt_sale/__manifest__.py | 2 +- helpdesk_mgmt_sale/i18n/es.po | 2 +- helpdesk_mgmt_sale/i18n/helpdesk_mgmt_sale.pot | 2 +- .../migrations/15.0.2.0.0/post-migration.py | 18 ++++++++++++++++++ helpdesk_mgmt_sale/models/helpdesk_ticket.py | 6 +++--- helpdesk_mgmt_sale/models/sale_order.py | 2 +- .../static/description/index.html | 2 +- .../tests/test_helpdesk_ticket.py | 10 ++++++---- helpdesk_mgmt_sale/views/sale_order_views.xml | 2 +- 10 files changed, 34 insertions(+), 14 deletions(-) create mode 100644 helpdesk_mgmt_sale/migrations/15.0.2.0.0/post-migration.py diff --git a/helpdesk_mgmt_sale/README.rst b/helpdesk_mgmt_sale/README.rst index 41a09a0892..009948ad7e 100644 --- a/helpdesk_mgmt_sale/README.rst +++ b/helpdesk_mgmt_sale/README.rst @@ -7,7 +7,7 @@ Helpdesk Sale Order !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:01e1efa36c6e799c149291e34ff665ab891fb45fd2e9026b0f39a760c0bd4382 + !! source digest: sha256:8d126fce4ed269cbcbb629bb3ca3b833d1d1c6c6dc5fd01034c9735d5593fcd9 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/helpdesk_mgmt_sale/__manifest__.py b/helpdesk_mgmt_sale/__manifest__.py index c774c6c2c1..624fd258df 100644 --- a/helpdesk_mgmt_sale/__manifest__.py +++ b/helpdesk_mgmt_sale/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Helpdesk Sale Order", "summary": "Add the option to select project in the sale orders.", - "version": "15.0.1.0.0", + "version": "15.0.2.0.0", "license": "AGPL-3", "category": "Sales Management", "author": "Tecnativa," "Odoo Community Association (OCA)", diff --git a/helpdesk_mgmt_sale/i18n/es.po b/helpdesk_mgmt_sale/i18n/es.po index fd89ccc1bc..01c97d8749 100644 --- a/helpdesk_mgmt_sale/i18n/es.po +++ b/helpdesk_mgmt_sale/i18n/es.po @@ -47,6 +47,6 @@ msgid "Sales Order" msgstr "Pedidos" #. module: helpdesk_mgmt_sale -#: model:ir.model.fields,field_description:helpdesk_mgmt_sale.field_sale_order__ticket_id +#: model:ir.model.fields,field_description:helpdesk_mgmt_sale.field_sale_order__ticket_ids msgid "Ticket" msgstr "Solicitud" diff --git a/helpdesk_mgmt_sale/i18n/helpdesk_mgmt_sale.pot b/helpdesk_mgmt_sale/i18n/helpdesk_mgmt_sale.pot index 434e682fa1..ddd980346f 100644 --- a/helpdesk_mgmt_sale/i18n/helpdesk_mgmt_sale.pot +++ b/helpdesk_mgmt_sale/i18n/helpdesk_mgmt_sale.pot @@ -44,6 +44,6 @@ msgid "Sales Order" msgstr "" #. module: helpdesk_mgmt_sale -#: model:ir.model.fields,field_description:helpdesk_mgmt_sale.field_sale_order__ticket_id +#: model:ir.model.fields,field_description:helpdesk_mgmt_sale.field_sale_order__ticket_ids msgid "Ticket" msgstr "" diff --git a/helpdesk_mgmt_sale/migrations/15.0.2.0.0/post-migration.py b/helpdesk_mgmt_sale/migrations/15.0.2.0.0/post-migration.py new file mode 100644 index 0000000000..fb87fc5670 --- /dev/null +++ b/helpdesk_mgmt_sale/migrations/15.0.2.0.0/post-migration.py @@ -0,0 +1,18 @@ +# Copyright 2024 Tecnativa - Pilar Vargas +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from openupgradelib import openupgrade + + +def convert_sale_order_tickets(env): + openupgrade.m2o_to_x2m( + env.cr, + env["sale.order"], + "sale_order", + "ticket_ids", + "ticket_id", + ) + + +@openupgrade.migrate() +def migrate(env, version): + convert_sale_order_tickets(env) diff --git a/helpdesk_mgmt_sale/models/helpdesk_ticket.py b/helpdesk_mgmt_sale/models/helpdesk_ticket.py index f88ccc68e6..c7d7a58017 100644 --- a/helpdesk_mgmt_sale/models/helpdesk_ticket.py +++ b/helpdesk_mgmt_sale/models/helpdesk_ticket.py @@ -4,7 +4,7 @@ class HelpdeskTicket(models.Model): _inherit = "helpdesk.ticket" - sale_order_ids = fields.One2many("sale.order", "ticket_id") + sale_order_ids = fields.Many2many("sale.order") so_count = fields.Integer( string="Sale Order Count", compute="_compute_so_count", store=True ) @@ -17,9 +17,9 @@ def _compute_so_count(self): 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["domain"] = [("ticket_ids", "in", [self.id])] action["context"] = { - "default_ticket_id": self.id, + "default_ticket_ids": [(4, [self.id])], "default_partner_id": self.partner_id.id, } return action diff --git a/helpdesk_mgmt_sale/models/sale_order.py b/helpdesk_mgmt_sale/models/sale_order.py index 56424d3461..23d0a7a3c3 100644 --- a/helpdesk_mgmt_sale/models/sale_order.py +++ b/helpdesk_mgmt_sale/models/sale_order.py @@ -4,4 +4,4 @@ class SaleOrder(models.Model): _inherit = "sale.order" - ticket_id = fields.Many2one("helpdesk.ticket") + ticket_ids = fields.Many2many("helpdesk.ticket") diff --git a/helpdesk_mgmt_sale/static/description/index.html b/helpdesk_mgmt_sale/static/description/index.html index 615a290a50..3c02a2e7f1 100644 --- a/helpdesk_mgmt_sale/static/description/index.html +++ b/helpdesk_mgmt_sale/static/description/index.html @@ -367,7 +367,7 @@

    Helpdesk Sale Order

    !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:01e1efa36c6e799c149291e34ff665ab891fb45fd2e9026b0f39a760c0bd4382 +!! source digest: sha256:8d126fce4ed269cbcbb629bb3ca3b833d1d1c6c6dc5fd01034c9735d5593fcd9 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

    Beta License: AGPL-3 OCA/helpdesk Translate me on Weblate Try me on Runboat

    This module extends the Helpdesk functionality in Odoo to allow an integration between diff --git a/helpdesk_mgmt_sale/tests/test_helpdesk_ticket.py b/helpdesk_mgmt_sale/tests/test_helpdesk_ticket.py index cbbc863110..b3523de33b 100644 --- a/helpdesk_mgmt_sale/tests/test_helpdesk_ticket.py +++ b/helpdesk_mgmt_sale/tests/test_helpdesk_ticket.py @@ -20,13 +20,13 @@ def setUpClass(cls): cls.sale_order_1 = cls.env["sale.order"].create( { "partner_id": cls.partner.id, - "ticket_id": cls.ticket.id, + "ticket_ids": [(6, 0, [cls.ticket.id])], # Adaptación a Many2many } ) cls.sale_order_2 = cls.env["sale.order"].create( { "partner_id": cls.partner.id, - "ticket_id": cls.ticket.id, + "ticket_ids": [(6, 0, [cls.ticket.id])], # Adaptación a Many2many } ) @@ -49,5 +49,7 @@ def test_smartbutton_sale_order_count(self): def test_action_view_sale_orders(self): # Verify that the smartbutton action displays the associated orders correctly. action = self.ticket.action_view_sale_orders() - self.assertEqual(action["domain"], [("ticket_id", "=", self.ticket.id)]) - self.assertEqual(action["context"]["default_ticket_id"], self.ticket.id) + self.assertEqual(action["domain"], [("ticket_ids", "in", [self.ticket.id])]) + self.assertEqual( + action["context"]["default_ticket_ids"], [(4, [self.ticket.id])] + ) diff --git a/helpdesk_mgmt_sale/views/sale_order_views.xml b/helpdesk_mgmt_sale/views/sale_order_views.xml index c209380afd..2de013adbe 100644 --- a/helpdesk_mgmt_sale/views/sale_order_views.xml +++ b/helpdesk_mgmt_sale/views/sale_order_views.xml @@ -12,7 +12,7 @@ - + From 74dd2508f23c675ecfd75f619b095e7df1d9182b Mon Sep 17 00:00:00 2001 From: pilarvargas-tecnativa Date: Tue, 1 Oct 2024 09:56:29 +0200 Subject: [PATCH 5/7] [IMP] helpdesk_mgmt_sale: Access tickets from the order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With the widget ‘many2many_tags’ it is not possible to click on a ticket in the order and access the form. By adding a smartbutton it is possible to access the list of tickets in the order and also consult the form for each one of them. TT50683 [UPD] Update helpdesk_mgmt_sale.pot [BOT] post-merge updates Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: helpdesk-15.0/helpdesk-15.0-helpdesk_mgmt_sale Translate-URL: https://translation.odoo-community.org/projects/helpdesk-15-0/helpdesk-15-0-helpdesk_mgmt_sale/ --- helpdesk_mgmt_sale/README.rst | 2 +- helpdesk_mgmt_sale/__manifest__.py | 2 +- helpdesk_mgmt_sale/i18n/es.po | 11 +++++++++++ helpdesk_mgmt_sale/i18n/helpdesk_mgmt_sale.pot | 11 +++++++++++ helpdesk_mgmt_sale/models/sale_order.py | 10 +++++++++- helpdesk_mgmt_sale/static/description/index.html | 2 +- helpdesk_mgmt_sale/tests/test_helpdesk_ticket.py | 4 ++-- helpdesk_mgmt_sale/views/helpdesk_ticket_views.xml | 9 ++++++++- helpdesk_mgmt_sale/views/sale_order_views.xml | 11 +++++++++++ 9 files changed, 55 insertions(+), 7 deletions(-) diff --git a/helpdesk_mgmt_sale/README.rst b/helpdesk_mgmt_sale/README.rst index 009948ad7e..9c72614ada 100644 --- a/helpdesk_mgmt_sale/README.rst +++ b/helpdesk_mgmt_sale/README.rst @@ -7,7 +7,7 @@ Helpdesk Sale Order !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:8d126fce4ed269cbcbb629bb3ca3b833d1d1c6c6dc5fd01034c9735d5593fcd9 + !! source digest: sha256:9058b48ff43b86b6c8dd426fccf2d6ccf02d75989c508e82bee02b5bfe550bcf !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/helpdesk_mgmt_sale/__manifest__.py b/helpdesk_mgmt_sale/__manifest__.py index 624fd258df..7905cda0e1 100644 --- a/helpdesk_mgmt_sale/__manifest__.py +++ b/helpdesk_mgmt_sale/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Helpdesk Sale Order", "summary": "Add the option to select project in the sale orders.", - "version": "15.0.2.0.0", + "version": "15.0.2.1.0", "license": "AGPL-3", "category": "Sales Management", "author": "Tecnativa," "Odoo Community Association (OCA)", diff --git a/helpdesk_mgmt_sale/i18n/es.po b/helpdesk_mgmt_sale/i18n/es.po index 01c97d8749..98ceb79687 100644 --- a/helpdesk_mgmt_sale/i18n/es.po +++ b/helpdesk_mgmt_sale/i18n/es.po @@ -50,3 +50,14 @@ msgstr "Pedidos" #: 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 "" diff --git a/helpdesk_mgmt_sale/i18n/helpdesk_mgmt_sale.pot b/helpdesk_mgmt_sale/i18n/helpdesk_mgmt_sale.pot index ddd980346f..9a4c4b5e3a 100644 --- a/helpdesk_mgmt_sale/i18n/helpdesk_mgmt_sale.pot +++ b/helpdesk_mgmt_sale/i18n/helpdesk_mgmt_sale.pot @@ -47,3 +47,14 @@ msgstr "" #: 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 "" diff --git a/helpdesk_mgmt_sale/models/sale_order.py b/helpdesk_mgmt_sale/models/sale_order.py index 23d0a7a3c3..b1e89a4605 100644 --- a/helpdesk_mgmt_sale/models/sale_order.py +++ b/helpdesk_mgmt_sale/models/sale_order.py @@ -1,7 +1,15 @@ -from odoo import fields, models +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) diff --git a/helpdesk_mgmt_sale/static/description/index.html b/helpdesk_mgmt_sale/static/description/index.html index 3c02a2e7f1..1ab3458965 100644 --- a/helpdesk_mgmt_sale/static/description/index.html +++ b/helpdesk_mgmt_sale/static/description/index.html @@ -367,7 +367,7 @@

    Helpdesk Sale Order

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

    Beta License: AGPL-3 OCA/helpdesk Translate me on Weblate Try me on Runboat

    This module extends the Helpdesk functionality in Odoo to allow an integration between diff --git a/helpdesk_mgmt_sale/tests/test_helpdesk_ticket.py b/helpdesk_mgmt_sale/tests/test_helpdesk_ticket.py index b3523de33b..a8946e29b9 100644 --- a/helpdesk_mgmt_sale/tests/test_helpdesk_ticket.py +++ b/helpdesk_mgmt_sale/tests/test_helpdesk_ticket.py @@ -20,13 +20,13 @@ def setUpClass(cls): cls.sale_order_1 = cls.env["sale.order"].create( { "partner_id": cls.partner.id, - "ticket_ids": [(6, 0, [cls.ticket.id])], # Adaptación a Many2many + "ticket_ids": [(6, 0, [cls.ticket.id])], } ) cls.sale_order_2 = cls.env["sale.order"].create( { "partner_id": cls.partner.id, - "ticket_ids": [(6, 0, [cls.ticket.id])], # Adaptación a Many2many + "ticket_ids": [(6, 0, [cls.ticket.id])], } ) diff --git a/helpdesk_mgmt_sale/views/helpdesk_ticket_views.xml b/helpdesk_mgmt_sale/views/helpdesk_ticket_views.xml index 8ad5f9e9bd..7f4c831be7 100644 --- a/helpdesk_mgmt_sale/views/helpdesk_ticket_views.xml +++ b/helpdesk_mgmt_sale/views/helpdesk_ticket_views.xml @@ -15,11 +15,18 @@ name="action_view_sale_orders" type="object" class="oe_stat_button" - icon="fa-ticket" + icon="fa-dollar" > + + Tickets + helpdesk.ticket + tree,form + [('sale_order_ids', 'in', active_id)] + {'default_sale_order_ids': [(4, active_id)]} + diff --git a/helpdesk_mgmt_sale/views/sale_order_views.xml b/helpdesk_mgmt_sale/views/sale_order_views.xml index 2de013adbe..f5a4e1e74d 100644 --- a/helpdesk_mgmt_sale/views/sale_order_views.xml +++ b/helpdesk_mgmt_sale/views/sale_order_views.xml @@ -15,6 +15,17 @@ + + + From 91383b1b0f3e3bbc3bfe550de7891e87a09bc72f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Wed, 15 Jan 2025 17:05:24 +0100 Subject: [PATCH 6/7] [IMP] helpdesk_mgmt_sale: pre-commit auto fixes --- helpdesk_mgmt_sale/README.rst | 39 ++++++++++--------- helpdesk_mgmt_sale/pyproject.toml | 3 ++ helpdesk_mgmt_sale/readme/CONTRIBUTORS.md | 2 + helpdesk_mgmt_sale/readme/CONTRIBUTORS.rst | 3 -- helpdesk_mgmt_sale/readme/DESCRIPTION.md | 4 ++ helpdesk_mgmt_sale/readme/DESCRIPTION.rst | 4 -- helpdesk_mgmt_sale/readme/USAGE.md | 9 +++++ helpdesk_mgmt_sale/readme/USAGE.rst | 6 --- .../static/description/index.html | 23 ++++++----- 9 files changed, 52 insertions(+), 41 deletions(-) create mode 100644 helpdesk_mgmt_sale/pyproject.toml create mode 100644 helpdesk_mgmt_sale/readme/CONTRIBUTORS.md delete mode 100644 helpdesk_mgmt_sale/readme/CONTRIBUTORS.rst create mode 100644 helpdesk_mgmt_sale/readme/DESCRIPTION.md delete mode 100644 helpdesk_mgmt_sale/readme/DESCRIPTION.rst create mode 100644 helpdesk_mgmt_sale/readme/USAGE.md delete mode 100644 helpdesk_mgmt_sale/readme/USAGE.rst diff --git a/helpdesk_mgmt_sale/README.rst b/helpdesk_mgmt_sale/README.rst index 9c72614ada..cccca9c1a5 100644 --- a/helpdesk_mgmt_sale/README.rst +++ b/helpdesk_mgmt_sale/README.rst @@ -17,21 +17,21 @@ Helpdesk Sale Order :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 + :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-15-0/helpdesk-15-0-helpdesk_mgmt_sale + :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=15.0 + :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. +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** @@ -43,10 +43,13 @@ 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. +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 =========== @@ -54,7 +57,7 @@ Bug Tracker Bugs are tracked on `GitHub 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -62,19 +65,19 @@ Credits ======= Authors -~~~~~~~ +------- * Tecnativa Contributors -~~~~~~~~~~~~ +------------ -* `Tecnativa `_: +- `Tecnativa `__: - * Pilar Vargas + - Pilar Vargas Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -86,6 +89,6 @@ 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 `_ project on GitHub. +This module is part of the `OCA/helpdesk `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/helpdesk_mgmt_sale/pyproject.toml b/helpdesk_mgmt_sale/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/helpdesk_mgmt_sale/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/helpdesk_mgmt_sale/readme/CONTRIBUTORS.md b/helpdesk_mgmt_sale/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..df940da7c6 --- /dev/null +++ b/helpdesk_mgmt_sale/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- [Tecnativa](https://www.tecnativa.com): + - Pilar Vargas diff --git a/helpdesk_mgmt_sale/readme/CONTRIBUTORS.rst b/helpdesk_mgmt_sale/readme/CONTRIBUTORS.rst deleted file mode 100644 index 44075b9f25..0000000000 --- a/helpdesk_mgmt_sale/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,3 +0,0 @@ -* `Tecnativa `_: - - * Pilar Vargas diff --git a/helpdesk_mgmt_sale/readme/DESCRIPTION.md b/helpdesk_mgmt_sale/readme/DESCRIPTION.md new file mode 100644 index 0000000000..c5cdd99ad8 --- /dev/null +++ b/helpdesk_mgmt_sale/readme/DESCRIPTION.md @@ -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. diff --git a/helpdesk_mgmt_sale/readme/DESCRIPTION.rst b/helpdesk_mgmt_sale/readme/DESCRIPTION.rst deleted file mode 100644 index af71e8d0c7..0000000000 --- a/helpdesk_mgmt_sale/readme/DESCRIPTION.rst +++ /dev/null @@ -1,4 +0,0 @@ -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. diff --git a/helpdesk_mgmt_sale/readme/USAGE.md b/helpdesk_mgmt_sale/readme/USAGE.md new file mode 100644 index 0000000000..af3580e3e4 --- /dev/null +++ b/helpdesk_mgmt_sale/readme/USAGE.md @@ -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. diff --git a/helpdesk_mgmt_sale/readme/USAGE.rst b/helpdesk_mgmt_sale/readme/USAGE.rst deleted file mode 100644 index 2628bcdec6..0000000000 --- a/helpdesk_mgmt_sale/readme/USAGE.rst +++ /dev/null @@ -1,6 +0,0 @@ -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. diff --git a/helpdesk_mgmt_sale/static/description/index.html b/helpdesk_mgmt_sale/static/description/index.html index 1ab3458965..cc332323b4 100644 --- a/helpdesk_mgmt_sale/static/description/index.html +++ b/helpdesk_mgmt_sale/static/description/index.html @@ -369,11 +369,11 @@

    Helpdesk Sale Order

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:9058b48ff43b86b6c8dd426fccf2d6ccf02d75989c508e82bee02b5bfe550bcf !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

    Beta License: AGPL-3 OCA/helpdesk Translate me on Weblate Try me on Runboat

    -

    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.

    +

    Beta License: AGPL-3 OCA/helpdesk Translate me on Weblate Try me on Runboat

    +

    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

      @@ -392,9 +392,12 @@

      Usage

      To associate orders to Helpdesk tickets:

      1. Create or modify a Helpdesk ticket.
      2. -
      3. In the ticket view, you will find a Sales Order Smartbutton which will show the number of orders associated to the ticket.
      4. -
      5. Clicking on the Smartbutton will open a view with all the sales orders related to the current ticket.
      6. -
      7. To create an order associated to the ticket click on the Create button.
      8. +
      9. In the ticket view, you will find a Sales Order Smartbutton which +will show the number of orders associated to the ticket.
      10. +
      11. Clicking on the Smartbutton will open a view with all the sales +orders related to the current ticket.
      12. +
      13. To create an order associated to the ticket click on the Create +button.
    @@ -402,7 +405,7 @@

    Bug Tracker

    Bugs are tracked on GitHub 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.

    +feedback.

    Do not contact contributors directly about support or help with technical issues.

    @@ -431,7 +434,7 @@

    Maintainers

    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 project on GitHub.

    +

    This module is part of the OCA/helpdesk project on GitHub.

    You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

    From f7ba5cdd7245686a550bfaf729a5aa458d191bbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Wed, 15 Jan 2025 17:07:59 +0100 Subject: [PATCH 7/7] [MIG] helpdesk_mgmt_sale: Migration to 17.0 TT52326 --- helpdesk_mgmt_sale/README.rst | 4 ++-- helpdesk_mgmt_sale/__manifest__.py | 4 ++-- .../migrations/15.0.2.0.0/post-migration.py | 18 ------------------ .../static/description/index.html | 2 +- .../tests/test_helpdesk_ticket.py | 4 ++-- .../views/helpdesk_ticket_views.xml | 5 +---- helpdesk_mgmt_sale/views/sale_order_views.xml | 11 ++++++----- 7 files changed, 14 insertions(+), 34 deletions(-) delete mode 100644 helpdesk_mgmt_sale/migrations/15.0.2.0.0/post-migration.py diff --git a/helpdesk_mgmt_sale/README.rst b/helpdesk_mgmt_sale/README.rst index cccca9c1a5..1add284fbe 100644 --- a/helpdesk_mgmt_sale/README.rst +++ b/helpdesk_mgmt_sale/README.rst @@ -10,9 +10,9 @@ Helpdesk Sale Order !! source digest: sha256:9058b48ff43b86b6c8dd426fccf2d6ccf02d75989c508e82bee02b5bfe550bcf !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png +.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png :target: https://odoo-community.org/page/development-status - :alt: Beta + :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 diff --git a/helpdesk_mgmt_sale/__manifest__.py b/helpdesk_mgmt_sale/__manifest__.py index 7905cda0e1..eff6b8c4a5 100644 --- a/helpdesk_mgmt_sale/__manifest__.py +++ b/helpdesk_mgmt_sale/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Helpdesk Sale Order", "summary": "Add the option to select project in the sale orders.", - "version": "15.0.2.1.0", + "version": "17.0.1.0.0", "license": "AGPL-3", "category": "Sales Management", "author": "Tecnativa," "Odoo Community Association (OCA)", @@ -13,6 +13,6 @@ "views/helpdesk_ticket_views.xml", "views/sale_order_views.xml", ], - "development_status": "Beta", + "development_status": "Production/Stable", "auto_install": True, } diff --git a/helpdesk_mgmt_sale/migrations/15.0.2.0.0/post-migration.py b/helpdesk_mgmt_sale/migrations/15.0.2.0.0/post-migration.py deleted file mode 100644 index fb87fc5670..0000000000 --- a/helpdesk_mgmt_sale/migrations/15.0.2.0.0/post-migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 2024 Tecnativa - Pilar Vargas -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openupgradelib import openupgrade - - -def convert_sale_order_tickets(env): - openupgrade.m2o_to_x2m( - env.cr, - env["sale.order"], - "sale_order", - "ticket_ids", - "ticket_id", - ) - - -@openupgrade.migrate() -def migrate(env, version): - convert_sale_order_tickets(env) diff --git a/helpdesk_mgmt_sale/static/description/index.html b/helpdesk_mgmt_sale/static/description/index.html index cc332323b4..21bd1cf9bf 100644 --- a/helpdesk_mgmt_sale/static/description/index.html +++ b/helpdesk_mgmt_sale/static/description/index.html @@ -369,7 +369,7 @@

    Helpdesk Sale Order

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:9058b48ff43b86b6c8dd426fccf2d6ccf02d75989c508e82bee02b5bfe550bcf !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

    Beta License: AGPL-3 OCA/helpdesk Translate me on Weblate Try me on Runboat

    +

    Production/Stable License: AGPL-3 OCA/helpdesk Translate me on Weblate Try me on Runboat

    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 diff --git a/helpdesk_mgmt_sale/tests/test_helpdesk_ticket.py b/helpdesk_mgmt_sale/tests/test_helpdesk_ticket.py index a8946e29b9..1a142276f1 100644 --- a/helpdesk_mgmt_sale/tests/test_helpdesk_ticket.py +++ b/helpdesk_mgmt_sale/tests/test_helpdesk_ticket.py @@ -1,9 +1,9 @@ # Copyright (C) 2024 Tecnativa - Pilar Vargas # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo.tests.common import TransactionCase +from odoo.addons.base.tests.common import BaseCommon -class TestHelpdeskTicketSale(TransactionCase): +class TestHelpdeskTicketSale(BaseCommon): @classmethod def setUpClass(cls): super().setUpClass() diff --git a/helpdesk_mgmt_sale/views/helpdesk_ticket_views.xml b/helpdesk_mgmt_sale/views/helpdesk_ticket_views.xml index 7f4c831be7..16455a4745 100644 --- a/helpdesk_mgmt_sale/views/helpdesk_ticket_views.xml +++ b/helpdesk_mgmt_sale/views/helpdesk_ticket_views.xml @@ -5,10 +5,6 @@ helpdesk.ticket - diff --git a/helpdesk_mgmt_sale/views/sale_order_views.xml b/helpdesk_mgmt_sale/views/sale_order_views.xml index f5a4e1e74d..f254ae8090 100644 --- a/helpdesk_mgmt_sale/views/sale_order_views.xml +++ b/helpdesk_mgmt_sale/views/sale_order_views.xml @@ -5,14 +5,14 @@ sale.order - - + @@ -22,6 +22,7 @@ class="btn btn-primary" icon="fa-ticket" context="{'default_sale_order_ids': [(4, id)]}" + groups="helpdesk_mgmt.group_helpdesk_user_own" >