Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions helpdesk_project/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
19 changes: 19 additions & 0 deletions helpdesk_project/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# © 2020 Nicolas Bessi (Camptocamp SA)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
'name': 'Helpdesk Project',
'summary': "Split first name and last name for non company partners",
'version': '11.0.1.0.1',
'author': "Alberto Esteban",
'license': "AGPL-3",
'maintainer': 'Camptocamp, Acsone',
'category': 'Helpdesk',
'website': 'https://odoo-community.org/',
'depends': ['mail'],
'data': [

],
'installable': True,
}
1 change: 1 addition & 0 deletions helpdesk_project/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import test_helpdesk_project
54 changes: 54 additions & 0 deletions helpdesk_project/tests/test_helpdesk_project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#Ticket in a project
'''
from odoo.tests import common

@classmethod
class TestHelpdeskTicketProject(common)
def ticket_in_proyect(self):
super(TestHelpdeskTicketProject, self).setUpClass()

Ticket = env['helpdesk.ticket']
Project = env["project.project"]

#ticket belongs to a project
-we create the new ticket
self.ticket = Ticket.create({
'name': 'Test',
'description': 'Ticket test',
})

-assign the new ticket to a project

self.project = Project.create({
'name': 'Test Helpdesk-Project',
})
self.ticket.write({
'project_id': self.project.id,
})

-button ticket count +1
self.project.write({
'ticket_count': self.ticket_count+1
})
-check the count of the button is right

def test_helpdesk_ticket_project(self):
self.assertNotEquals(self.ticket.project_id, 'False',
'Helpdesk Ticket: A ticket should have '
'a project.')

def test_helpdesk_ticket_counts(self):
self.assertequal(self.project_id.ticket_count,
1,
'Helpdesk Ticket: Project assigned '
'one ticket')

self.helpdesk_ticket.write({
'stage_id': self.stage_closed.id,
})

self.assertequal(self.project_id.ticket_count,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense this test?, You set a ticket in project, and check the project ticket count, then, change de ticket state, and again check the project ticket count... Think that you are not checking the number of open tickets, if not the total. If you were checking the open ones the cash should go down one, also the field name should be representative of the state (open_ticket_count for example)

1,
'Helpdesk Ticket: Project assigned '
'one ticket')
'''