Add merged_to information to ticket

This commit is contained in:
bbe 2020-10-29 23:29:16 +01:00
parent 79d8046694
commit 9795167d9b
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,19 @@
# Generated by Django 2.2.13 on 2020-10-27 17:14
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('helpdesk', '0032_kbitem_enabled'),
]
operations = [
migrations.AddField(
model_name='ticket',
name='merged_to',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='merged_tickets', to='helpdesk.Ticket', verbose_name='merged to'),
),
]

View File

@ -569,6 +569,15 @@ class Ticket(models.Model):
verbose_name=_('Knowledge base item the user was viewing when they created this ticket.'),
)
merged_to = models.ForeignKey(
'self',
verbose_name=_('merged to'),
related_name='merged_tickets',
on_delete=models.CASCADE,
null=True,
blank=True
)
@property
def time_spent(self):
"""Return back total time spent on the ticket. This is calculated value