23
23
from datetime import datetime, timedelta
26
#FUTURE: create a module to assign working calendars per team
27
#class crm_case_section(osv.osv):
28
# _inherit = "crm.case.section"
30
# 'resource_calendar_id' : fields.many2one('resource.calendar', 'Working Time',\
31
# help="Timetable working hours to calculate issue open time", ),
36
27
class project_issue(osv.osv):
37
28
_inherit = 'project.issue'
40
31
'functional_block_id': fields.many2one('project.functional_block', 'Component', help = "Component (system, module, function) to be adressed"),
41
32
'assigned_to': fields.related('task_id', 'user_id', string = 'Task Assigned to', type="many2one", relation="res.users", store=True, help='This is the current user to whom the related task was assigned'),
42
'ref': fields.char('Code', size=10, readonly=True, select=True, help="Issue sequence number"),
43
33
'tasks': fields.one2many('project.task', 'issue_id', 'Related tasks', help="Task history for the issue"),
44
34
'create_uid': fields.many2one('res.users', 'Created by', help = "Person who reported the issue"),
46
36
'categ_id': fields.many2one('crm.case.categ', 'Category', required=True,
47
domain="[('object_id.model', '=', 'project.issue'),('parent_id','!=',None)]",
37
domain="[('object_id.model','=','project.issue')]",
48
38
help="Only categories with a parent will be selectable in the Issues form."),
51
def create(self, cr, uid, vals, context={}):
53
vals['ref'] = self.pool.get('ir.sequence').next_by_code(cr, uid, 'project.issue')
54
return super(project_issue, self).create(cr, uid, vals, context)
56
41
def case_open(self, cr, uid, ids, *args):
57
42
"""Open Issue preserving the assigned user_id.