From deb512dacd7e1dbb9f819b22fbc5097754526a54 Mon Sep 17 00:00:00 2001 From: anusrinps96 Date: Mon, 22 Jul 2024 09:29:56 +0200 Subject: [PATCH] [MIG] helpdesk_mgmt_fieldservice: Migration to 16.0 --- helpdesk_mgmt_fieldservice/README.rst | 10 +++++----- helpdesk_mgmt_fieldservice/__manifest__.py | 8 ++++++-- helpdesk_mgmt_fieldservice/models/__init__.py | 1 + .../models/helpdesk_ticket.py | 2 +- .../models/res_partner.py | 20 +++++++++++++++++++ .../security/ir.model.access.csv | 2 +- .../static/description/index.html | 18 +++++++++-------- .../tests/test_helpdesk_ticket_fsm_order.py | 4 ++-- .../views/helpdesk_ticket_views.xml | 13 ------------ .../views/res_partner.xml | 17 ---------------- .../wizards/fsm_order_close_wizard.py | 2 +- 11 files changed, 47 insertions(+), 50 deletions(-) create mode 100644 helpdesk_mgmt_fieldservice/models/res_partner.py delete mode 100644 helpdesk_mgmt_fieldservice/views/res_partner.xml diff --git a/helpdesk_mgmt_fieldservice/README.rst b/helpdesk_mgmt_fieldservice/README.rst index 0597fde767..9405a39305 100644 --- a/helpdesk_mgmt_fieldservice/README.rst +++ b/helpdesk_mgmt_fieldservice/README.rst @@ -17,13 +17,13 @@ Helpdesk Mgmt Fieldservice :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/14.0/helpdesk_mgmt_fieldservice + :target: https://github.com/OCA/helpdesk/tree/16.0/helpdesk_mgmt_fieldservice :alt: OCA/helpdesk .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/helpdesk-14-0/helpdesk-14-0-helpdesk_mgmt_fieldservice + :target: https://translation.odoo-community.org/projects/helpdesk-16-0/helpdesk-16-0-helpdesk_mgmt_fieldservice :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=14.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/helpdesk&target_branch=16.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -69,7 +69,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. @@ -103,6 +103,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_fieldservice/__manifest__.py b/helpdesk_mgmt_fieldservice/__manifest__.py index 685c0de253..833e082573 100644 --- a/helpdesk_mgmt_fieldservice/__manifest__.py +++ b/helpdesk_mgmt_fieldservice/__manifest__.py @@ -5,7 +5,7 @@ "name": "Helpdesk Mgmt Fieldservice", "summary": """ Create service orders from a ticket""", - "version": "14.0.1.1.2", + "version": "16.0.1.0.0", "license": "AGPL-3", "author": "Open Source Integrators, " "Escodoo, " @@ -20,8 +20,12 @@ "views/helpdesk_ticket_views.xml", "views/fsm_location_views.xml", "views/fsm_order_views.xml", - "views/res_partner.xml", "wizards/fsm_order_close_wizard.xml", ], + "assets": { + "web.assets_backend": [ + "helpdesk_mgmt_fieldservice/static/src/scss/helpdesk_column.scss", + ], + }, "demo": [], } diff --git a/helpdesk_mgmt_fieldservice/models/__init__.py b/helpdesk_mgmt_fieldservice/models/__init__.py index 80fa706191..a4cbfa6a55 100644 --- a/helpdesk_mgmt_fieldservice/models/__init__.py +++ b/helpdesk_mgmt_fieldservice/models/__init__.py @@ -3,3 +3,4 @@ from . import fsm_location from . import fsm_order from . import helpdesk_ticket +from . import res_partner diff --git a/helpdesk_mgmt_fieldservice/models/helpdesk_ticket.py b/helpdesk_mgmt_fieldservice/models/helpdesk_ticket.py index bf2bfa8c3d..b485318d5c 100644 --- a/helpdesk_mgmt_fieldservice/models/helpdesk_ticket.py +++ b/helpdesk_mgmt_fieldservice/models/helpdesk_ticket.py @@ -12,7 +12,7 @@ class HelpdeskTicket(models.Model): fsm_order_ids = fields.One2many("fsm.order", "ticket_id", string="Service Orders") fsm_location_id = fields.Many2one("fsm.location", string="FSM Location") all_orders_closed = fields.Boolean(compute="_compute_all_closed", store=True) - resolution = fields.Text(string="Resolution") + resolution = fields.Text() # these fields are needed to obtain depreciation of onchange in v14 partner_domain = fields.Integer(compute="_compute_partner_domain") all_partners = fields.Boolean(compute="_compute_partner_domain") diff --git a/helpdesk_mgmt_fieldservice/models/res_partner.py b/helpdesk_mgmt_fieldservice/models/res_partner.py new file mode 100644 index 0000000000..a7c0728be9 --- /dev/null +++ b/helpdesk_mgmt_fieldservice/models/res_partner.py @@ -0,0 +1,20 @@ +from odoo import models + + +class ResPartner(models.Model): + _inherit = "res.partner" + + def action_view_helpdesk_tickets(self): + # replacing context only when there are both the groups + if self.env.user.has_group( + "fieldservice.group_fsm_user_own" + ) and self.env.user.has_group("helpdesk_mgmt.group_helpdesk_user_own"): + context = dict(self.env.context) + context.pop("search_default_open", None) + self = self.with_context( + context, + default_partner_id=self.id, + default_fsm_location_id=self.service_location_id.id, + ) + return super(ResPartner, self).action_view_helpdesk_tickets() + return super().action_view_helpdesk_tickets diff --git a/helpdesk_mgmt_fieldservice/security/ir.model.access.csv b/helpdesk_mgmt_fieldservice/security/ir.model.access.csv index 1ac115d8f8..ce7f0da9f6 100644 --- a/helpdesk_mgmt_fieldservice/security/ir.model.access.csv +++ b/helpdesk_mgmt_fieldservice/security/ir.model.access.csv @@ -1,3 +1,3 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_helpdesk_ticket_fsm_user,helpdesk.ticket.fsm.user,model_helpdesk_ticket,fieldservice.group_fsm_user,1,0,0,0 -access_fsm_order_close_wizard,fsm.order.close.wizard,model_fsm_order_close_wizard,fieldservice.group_fsm_user,1,1,1.0 +access_fsm_order_close_wizard,fsm.order.close.wizard,model_fsm_order_close_wizard,fieldservice.group_fsm_user,1,1,1,0 diff --git a/helpdesk_mgmt_fieldservice/static/description/index.html b/helpdesk_mgmt_fieldservice/static/description/index.html index 71794dc338..64555dab43 100644 --- a/helpdesk_mgmt_fieldservice/static/description/index.html +++ b/helpdesk_mgmt_fieldservice/static/description/index.html @@ -1,4 +1,3 @@ - @@ -9,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. @@ -275,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 } @@ -301,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -369,7 +369,7 @@

Helpdesk Mgmt Fieldservice

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:2298c9baf4289333d16aa846aca9176b09d8ebdd66361ded2aa009262544a9ee !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

This module allows the helpdesk user to track the status of related service orders.

Table of contents

@@ -424,7 +424,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.

@@ -448,11 +448,13 @@

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.

-

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_fieldservice/tests/test_helpdesk_ticket_fsm_order.py b/helpdesk_mgmt_fieldservice/tests/test_helpdesk_ticket_fsm_order.py index 01f3bdb236..af34e18c43 100644 --- a/helpdesk_mgmt_fieldservice/tests/test_helpdesk_ticket_fsm_order.py +++ b/helpdesk_mgmt_fieldservice/tests/test_helpdesk_ticket_fsm_order.py @@ -1,10 +1,10 @@ # Copyright 2022 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo.tests.common import Form, SavepointCase +from odoo.tests.common import Form, TransactionCase -class TestHelpdeskTicketFSMOrder(SavepointCase): +class TestHelpdeskTicketFSMOrder(TransactionCase): @classmethod def setUpClass(cls): super().setUpClass() diff --git a/helpdesk_mgmt_fieldservice/views/helpdesk_ticket_views.xml b/helpdesk_mgmt_fieldservice/views/helpdesk_ticket_views.xml index 3e0e9bd92e..e46b3b7575 100644 --- a/helpdesk_mgmt_fieldservice/views/helpdesk_ticket_views.xml +++ b/helpdesk_mgmt_fieldservice/views/helpdesk_ticket_views.xml @@ -4,19 +4,6 @@ License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). --> - - helpdesk.ticket.service.request.form diff --git a/helpdesk_mgmt_fieldservice/views/res_partner.xml b/helpdesk_mgmt_fieldservice/views/res_partner.xml deleted file mode 100644 index 61079fb8fa..0000000000 --- a/helpdesk_mgmt_fieldservice/views/res_partner.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - res.partner.form.ticket.context - res.partner - - - - - - - - diff --git a/helpdesk_mgmt_fieldservice/wizards/fsm_order_close_wizard.py b/helpdesk_mgmt_fieldservice/wizards/fsm_order_close_wizard.py index c7ba219907..b65adba818 100644 --- a/helpdesk_mgmt_fieldservice/wizards/fsm_order_close_wizard.py +++ b/helpdesk_mgmt_fieldservice/wizards/fsm_order_close_wizard.py @@ -9,7 +9,7 @@ class FSMOrderCloseWizard(models.TransientModel): _name = "fsm.order.close.wizard" _description = "FSM Close - Option to Close Ticket" - resolution = fields.Text(string="Resolution") + resolution = fields.Text() team_id = fields.Many2one("helpdesk.ticket.team", string="Helpdesk Team") stage_id = fields.Many2one("helpdesk.ticket.stage", string="Stage") ticket_id = fields.Many2one("helpdesk.ticket", string="Ticket")