-
-
Notifications
You must be signed in to change notification settings - Fork 329
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
[16.0][ADD] helpdesk_partner_team_category: New module helpdesk_partn… #681
Open
lbarry-apsl
wants to merge
1
commit into
OCA:16.0
Choose a base branch
from
APSL:16.0-add-helpdesk_partner_team_category
base: 16.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
============================== | ||
Helpdesk Partner Team Category | ||
============================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:459bf4f496a3da407f8a5ba7aba3eac88c6ac7647013474afe51e2b85521bea3 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
||
.. |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/16.0/helpdesk_partner_team_category | ||
:alt: OCA/helpdesk | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/helpdesk-16-0/helpdesk-16-0-helpdesk_partner_team_category | ||
: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=16.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module allows you to restrict tems and categories for each | ||
coustumer. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Usage | ||
===== | ||
|
||
Go to the partner and select the teams and categories for which can open | ||
ticket | ||
|
||
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_partner_team_category%0Aversion:%2016.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 | ||
------- | ||
|
||
* Lansana Barry Sow | ||
* APSL-Nagarro | ||
|
||
Contributors | ||
------------ | ||
|
||
[APSL-Nagarro](https://apsl.tech): | ||
|
||
- Lansana Barry Sow <[email protected]> | ||
|
||
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. | ||
|
||
.. |maintainer-lbarry-apsl| image:: https://github.com/lbarry-apsl.png?size=40px | ||
:target: https://github.com/lbarry-apsl | ||
:alt: lbarry-apsl | ||
|
||
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: | ||
|
||
|maintainer-lbarry-apsl| | ||
|
||
This module is part of the `OCA/helpdesk <https://github.com/OCA/helpdesk/tree/16.0/helpdesk_partner_team_category>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import controllers | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright 2025 Lansana Barry Sow(APSL-Nagarro)<[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
{ | ||
"name": "Helpdesk Partner Team Category", | ||
"version": "16.0.1.0.0", | ||
"category": "Helpdesk", | ||
"website": "https://github.com/OCA/helpdesk", | ||
"author": "Lansana Barry Sow, APSL-Nagarro, Odoo Community Association (OCA)", | ||
"maintainers": ["lbarry-apsl"], | ||
"license": "AGPL-3", | ||
"application": False, | ||
"installable": True, | ||
"depends": [ | ||
"helpdesk_mgmt", | ||
], | ||
"data": [ | ||
"views/res_partner.xml", | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import logging | ||
|
||
import odoo.http as http | ||
from odoo.http import request | ||
|
||
from odoo.addons.helpdesk_mgmt.controllers.main import HelpdeskTicketController | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
|
||
class HelpdeskPartnerTeamCategoryController(HelpdeskTicketController): | ||
def _get_teams(self): | ||
if http.request.env.user.company_id.helpdesk_mgmt_portal_select_team: | ||
return ( | ||
http.request.env.user.partner_id.helpdesk_team_ids | ||
if http.request.env.user.partner_id.helpdesk_team_ids | ||
else http.request.env["helpdesk.ticket.team"] | ||
.sudo() | ||
.search([("active", "=", True), ("show_in_portal", "=", True)]) | ||
) | ||
else: | ||
return False | ||
|
||
def _get_category(self): | ||
return ( | ||
http.request.env.user.partner_id.helpdesk_category_ids | ||
if http.request.env.user.partner_id.helpdesk_category_ids | ||
else http.request.env["helpdesk.ticket.category"].search( | ||
[("active", "=", True)] | ||
) | ||
) | ||
|
||
@http.route("/new/ticket", type="http", auth="user", website=True) | ||
def create_new_ticket(self, **kw): | ||
session_info = http.request.env["ir.http"].session_info() | ||
email = http.request.env.user.email | ||
name = http.request.env.user.name | ||
company = request.env.company | ||
return http.request.render( | ||
"helpdesk_mgmt.portal_create_ticket", | ||
{ | ||
"categories": self._get_category(), | ||
"teams": self._get_teams(), | ||
"email": email, | ||
"name": name, | ||
"ticket_team_id_required": ( | ||
company.helpdesk_mgmt_portal_team_id_required | ||
), | ||
"ticket_category_id_required": ( | ||
company.helpdesk_mgmt_portal_category_id_required | ||
), | ||
"max_upload_size": session_info["max_file_upload_size"], | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from . import helpdesk_ticket_category | ||
from . import helpdesk_ticket_team | ||
from . import res_partner |
9 changes: 9 additions & 0 deletions
9
helpdesk_partner_team_category/models/helpdesk_ticket_category.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class HelpdeskTicketCategory(models.Model): | ||
_inherit = "helpdesk.ticket.category" | ||
|
||
helpdesk_category_partner_ids = fields.Many2many( | ||
"res.partner", "helpdesk_category_ids", string="Partners" | ||
) |
9 changes: 9 additions & 0 deletions
9
helpdesk_partner_team_category/models/helpdesk_ticket_team.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class HelpdeskTicketTeam(models.Model): | ||
_inherit = "helpdesk.ticket.team" | ||
|
||
helpdesk_partner_ids = fields.Many2many( | ||
"res.partner", "helpdesk_team_ids", string="Partners" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class ResPartner(models.Model): | ||
_inherit = "res.partner" | ||
|
||
helpdesk_team_ids = fields.Many2many( | ||
"helpdesk.ticket.team", | ||
"helpdesk_partner_ids", | ||
string="Available teams", | ||
required=True, | ||
) | ||
|
||
helpdesk_category_ids = fields.Many2many( | ||
"helpdesk.ticket.category", | ||
"helpdesk_category_partner_ids", | ||
string="Available category", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
\[APSL-Nagarro\](<https://apsl.tech>): | ||
- Lansana Barry Sow \<<[email protected]>\> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This module allows you to restrict tems and categories for each coustumer. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Go to the partner and select the teams and categories for which can open ticket |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 79 additions & 0 deletions
79
helpdesk_partner_team_category/static/description/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please correct the description.
tems -> teams, coustumer -> customer