[FIX]:Issue Menu:-Issue will be Convert Task Only when Issue in To Do State -- progressbar on issue to related with task progressbar >> Long Term Planning Menu:The Gantt View Display Phase Name ---calender view and Gantt View Display All Phases
bzr revid: ron@tinyerp.com-20101004131033-czvqbsgeebo2wu0w
This commit is contained in:
parent
5577ecd78a
commit
fdc839079f
|
@ -316,7 +316,7 @@ class project(osv.osv):
|
|||
if child_ids:
|
||||
self.setActive(cr, uid, child_ids, value, context=None)
|
||||
return True
|
||||
|
||||
|
||||
project()
|
||||
|
||||
class users(osv.osv):
|
||||
|
@ -523,7 +523,7 @@ class task(osv.osv):
|
|||
if not project_id: return False
|
||||
task = self.browse(cr, uid, project_id, context=context)
|
||||
project = task.project_id
|
||||
res = self.do_close(cr, uid, [project_id], context=context)
|
||||
res = self.do_close(cr, uid, [project_id], context=context)
|
||||
if project.warn_manager or project.warn_customer:
|
||||
return {
|
||||
'name': _('Send Email after close task'),
|
||||
|
@ -534,7 +534,7 @@ class task(osv.osv):
|
|||
'target': 'new',
|
||||
'nodestroy': True,
|
||||
'context': {'active_id': task.id}
|
||||
}
|
||||
}
|
||||
return res
|
||||
|
||||
def do_close(self, cr, uid, ids, context=None):
|
||||
|
@ -576,6 +576,8 @@ class task(osv.osv):
|
|||
if context is None:
|
||||
context = {}
|
||||
request = self.pool.get('res.request')
|
||||
p_issue = self.pool.get('project.issue')
|
||||
|
||||
for task in self.browse(cr, uid, ids, context=context):
|
||||
project = task.project_id
|
||||
if project and project.warn_manager and project.user_id.id and (project.user_id.id != uid):
|
||||
|
@ -590,10 +592,15 @@ class task(osv.osv):
|
|||
})
|
||||
|
||||
self.write(cr, uid, [task.id], {'state': 'open'})
|
||||
issue_id=p_issue.search(cr,uid,[('task_id','=',task.id)])
|
||||
p_issue.write(cr, uid,issue_id, {'progress':0.0})
|
||||
|
||||
return True
|
||||
|
||||
def do_cancel(self, cr, uid, ids, *args):
|
||||
request = self.pool.get('res.request')
|
||||
p_issue = self.pool.get('project.issue')
|
||||
print "Cancel"
|
||||
tasks = self.browse(cr, uid, ids)
|
||||
for task in tasks:
|
||||
project = task.project_id
|
||||
|
@ -609,7 +616,9 @@ class task(osv.osv):
|
|||
})
|
||||
message = _('Task ') + " '" + task.name + "' "+ _("is Cancelled.")
|
||||
self.log(cr, uid, task.id, message)
|
||||
issue_id=p_issue.search(cr,uid,[('task_id','=',task.id)])
|
||||
self.write(cr, uid, [task.id], {'state': 'cancelled', 'remaining_hours':0.0})
|
||||
p_issue.write(cr, uid,issue_id, {'progress':100.0})
|
||||
return True
|
||||
|
||||
def do_open(self, cr, uid, ids, *args):
|
||||
|
|
|
@ -141,7 +141,7 @@ class project_issue(crm.crm_case, osv.osv):
|
|||
else:
|
||||
res[issue.id][field] = abs(float(duration))
|
||||
return res
|
||||
|
||||
|
||||
_columns = {
|
||||
'id': fields.integer('ID'),
|
||||
'name': fields.char('Name', size=128, required=True),
|
||||
|
@ -220,48 +220,59 @@ class project_issue(crm.crm_case, osv.osv):
|
|||
data_obj = self.pool.get('ir.model.data')
|
||||
task_obj = self.pool.get('project.task')
|
||||
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
result = data_obj._get_id(cr, uid, 'project', 'view_task_search_form')
|
||||
res = data_obj.read(cr, uid, result, ['res_id'])
|
||||
id2 = data_obj._get_id(cr, uid, 'project', 'view_task_form2')
|
||||
id3 = data_obj._get_id(cr, uid, 'project', 'view_task_tree2')
|
||||
if id2:
|
||||
id2 = data_obj.browse(cr, uid, id2, context=context).res_id
|
||||
if id3:
|
||||
id3 = data_obj.browse(cr, uid, id3, context=context).res_id
|
||||
for curr_task in case_obj.browse(cr, uid,ids):
|
||||
if curr_task.state in ['open']:
|
||||
if context is None:
|
||||
context = {}
|
||||
result = data_obj._get_id(cr, uid, 'project', 'view_task_search_form')
|
||||
res = data_obj.read(cr, uid, result, ['res_id'])
|
||||
id2 = data_obj._get_id(cr, uid, 'project', 'view_task_form2')
|
||||
id3 = data_obj._get_id(cr, uid, 'project', 'view_task_tree2')
|
||||
if id2:
|
||||
id2 = data_obj.browse(cr, uid, id2, context=context).res_id
|
||||
if id3:
|
||||
id3 = data_obj.browse(cr, uid, id3, context=context).res_id
|
||||
|
||||
for bug in case_obj.browse(cr, uid, ids, context=context):
|
||||
new_task_id = task_obj.create(cr, uid, {
|
||||
'name': bug.name,
|
||||
'partner_id': bug.partner_id.id,
|
||||
'description':bug.description,
|
||||
'date': bug.date,
|
||||
'project_id': bug.project_id.id,
|
||||
'priority': bug.priority,
|
||||
'user_id': bug.assigned_to.id,
|
||||
'planned_hours': 0.0,
|
||||
})
|
||||
for bug in case_obj.browse(cr, uid, ids, context=context):
|
||||
new_task_id = task_obj.create(cr, uid, {
|
||||
'name': bug.name,
|
||||
'partner_id': bug.partner_id.id,
|
||||
'description':bug.description,
|
||||
'date': bug.date,
|
||||
'project_id': bug.project_id.id,
|
||||
'priority': bug.priority,
|
||||
'user_id': bug.assigned_to.id,
|
||||
'planned_hours': 0.0,
|
||||
})
|
||||
|
||||
vals = {
|
||||
'task_id': new_task_id,
|
||||
'state':'open'
|
||||
}
|
||||
case_obj.write(cr, uid, [bug.id], vals)
|
||||
vals = {
|
||||
'task_id': new_task_id,
|
||||
'state':'open'
|
||||
}
|
||||
case_obj.write(cr, uid, [bug.id], vals)
|
||||
|
||||
return {
|
||||
'name': _('Tasks'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form,tree',
|
||||
'res_model': 'project.task',
|
||||
'res_id': int(new_task_id),
|
||||
'view_id': False,
|
||||
'views': [(id2,'form'),(id3,'tree'),(False,'calendar'),(False,'graph')],
|
||||
'type': 'ir.actions.act_window',
|
||||
'search_view_id': res['res_id'],
|
||||
'nodestroy': True
|
||||
}
|
||||
elif curr_task.state in ['done', 'cancel']:
|
||||
raise osv.except_osv(_("Warning !"), _("Closed/Cancelled \
|
||||
Issue Could not convert into Task"))
|
||||
return True
|
||||
else:
|
||||
raise osv.except_osv(_("Warning !"), _("Issue should be in \
|
||||
\'To Do\' state before converting to Task."))
|
||||
return True
|
||||
|
||||
return {
|
||||
'name': _('Tasks'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form,tree',
|
||||
'res_model': 'project.task',
|
||||
'res_id': int(new_task_id),
|
||||
'view_id': False,
|
||||
'views': [(id2,'form'),(id3,'tree'),(False,'calendar'),(False,'graph')],
|
||||
'type': 'ir.actions.act_window',
|
||||
'search_view_id': res['res_id'],
|
||||
'nodestroy': True
|
||||
}
|
||||
|
||||
def _convert(self, cr, uid, ids, xml_id, context=None):
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
|
@ -288,11 +299,11 @@ class project_issue(crm.crm_case, osv.osv):
|
|||
if not stage.on_change:
|
||||
return {'value':{}}
|
||||
return {'value':{}}
|
||||
|
||||
|
||||
def onchange_task_id(self, cr, uid, ids, task_id, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
result = {}
|
||||
result = {}
|
||||
if not task_id:
|
||||
return {'value':{}}
|
||||
task = self.pool.get('project.task').browse(cr, uid, task_id, context)
|
||||
|
@ -442,7 +453,7 @@ class project_issue(crm.crm_case, osv.osv):
|
|||
@param **args: Return Dictionary of Keyword Value
|
||||
"""
|
||||
return True
|
||||
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
if not context:
|
||||
context={}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<gantt color="phase_id" date_start="date_start" date_stop="date_end" string="R.A." mode="year">
|
||||
<level object="res.users" link="user_id" domain="[]">
|
||||
<field name="useability" string="Availability"/>
|
||||
<field name="phase_id" string="Phase Name"/>
|
||||
</level>
|
||||
</gantt>
|
||||
</field>
|
||||
|
@ -326,7 +326,7 @@
|
|||
# ------------------------------------------------------
|
||||
# Project Task
|
||||
# ------------------------------------------------------
|
||||
|
||||
|
||||
<record id="view_phase_task_form2" model="ir.ui.view">
|
||||
<field name="name">phase.task.form2</field>
|
||||
<field name="model">project.task</field>
|
||||
|
@ -348,8 +348,8 @@
|
|||
<field name="phase_id" select="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</record>
|
||||
|
||||
<act_window
|
||||
id="project_phase_task_list"
|
||||
name="Related Tasks"
|
||||
|
|
Loading…
Reference in New Issue