Revert the add of the helpdesk contact name, we use the existent

This commit is contained in:
NaN?tic 2014-05-14 11:05:24 +02:00
parent e64a3d5e85
commit 405021688b
4 changed files with 4 additions and 20 deletions

View file

@ -5,7 +5,6 @@ from .work import *
def register():
Pool.register(
Activity,
Work,
WorkType,
module='project_helpdesk', type_='model')

View file

@ -4,7 +4,7 @@ this repository contains the full copyright notices and license terms. -->
<tree string="activity" editable="top">
<field name="type"/>
<field name="direction"/>
<field name="helpdesk_contact_name"/>
<field name="contact_name"/>
<field name="subject"/>
<field name="description"/>
</tree>

View file

@ -46,8 +46,8 @@ this repository contains the full copyright notices and license terms. -->
<field name="last_action_date"/>
<label name="channel"/>
<field name="channel"/>
<label name="helpdesk_contact_name"/>
<field name="helpdesk_contact_name"/>
<label name="contact_name"/>
<field name="contact_name"/>
<field name="activities" colspan="4" view_ids="project_helpdesk.activity_helpdesk_tree_view"/>
</page>
<page string="Allocations" id="allocations"

17
work.py
View file

@ -5,7 +5,7 @@ from trytond.pool import Pool, PoolMeta
from trytond.pyson import Eval, If, And
from trytond.transaction import Transaction
__all__ = ['Work', 'WorkType', 'Activity']
__all__ = ['Work', 'WorkType']
__metaclass__ = PoolMeta
@ -28,7 +28,6 @@ class Work:
'required': And(Eval('type') == 'project', Eval('helpdesk', False)),
'invisible': Eval('type') != 'project',
}, depends=['type', 'helpdesk'])
helpdesk_contact_name = fields.Function(fields.Char('Contact Name'), 'get_helpdesk_contact')
@staticmethod
def default_helpdesk():
@ -92,17 +91,3 @@ class Work:
for work in works:
work.check_helpdesk_project_creation()
work.check_helpdesk_task_creation()
def get_helpdesk_contact(self, name=None):
if not self.activities:
return None
Activity = Pool().get('activity.activity')
act = Activity.search([('resource', '=', 'project.work,%s' %
self.id)], order=[('dtstart', 'desc')], limit=1)
return act and act[0].helpdesk_contact_name or None
class Activity:
__name__ = 'activity.activity'
helpdesk_contact_name = fields.Char('Helpdesk Contact Name')