Skip to content

Commit

Permalink
[IMP] helpdesk_mgmt_crm: black, isort, prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
pilarvargas-tecnativa committed Sep 18, 2024
1 parent 5f0eb7c commit 6badb1a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
8 changes: 6 additions & 2 deletions helpdesk_mgmt_crm/models/helpdesk_ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ class HelpdeskTicket(models.Model):
_inherit = "helpdesk.ticket"

lead_ids = fields.One2many(
comodel_name="crm.lead", inverse_name="ticket_id", string="Opportunity(ies)",
comodel_name="crm.lead",
inverse_name="ticket_id",
string="Opportunity(ies)",
)
lead_count = fields.Integer(
compute="_compute_lead_count", string="Opportunity Count"
Expand All @@ -17,7 +19,9 @@ class HelpdeskTicket(models.Model):
@api.depends("lead_ids")
def _compute_lead_count(self):
lead_data = self.env["crm.lead"].read_group(
[("ticket_id", "in", self.ids)], ["ticket_id"], ["ticket_id"],
[("ticket_id", "in", self.ids)],
["ticket_id"],
["ticket_id"],
)
mapped_data = {t["ticket_id"][0]: t["ticket_id_count"] for t in lead_data}
for item in self:
Expand Down
4 changes: 3 additions & 1 deletion helpdesk_mgmt_crm/tests/test_helpdesk_mgmt_crm.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ def setUpClass(cls):
cls.team = cls.env["crm.team"].create(
{"name": "Test team", "member_ids": [(6, 0, [cls.user2.id])]}
)
cls.team.message_subscribe(partner_ids=[cls.user2.partner_id.id],)
cls.team.message_subscribe(
partner_ids=[cls.user2.partner_id.id],
)
cls.ticket = cls.env["helpdesk.ticket"].create(
{
"name": "Test ticket",
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# generated from manifests external_dependencies
html2text
1 change: 1 addition & 0 deletions setup/helpdesk_mgmt_crm/odoo/addons/helpdesk_mgmt_crm
6 changes: 6 additions & 0 deletions setup/helpdesk_mgmt_crm/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit 6badb1a

Please sign in to comment.