[IMP] The responsible of the project issue is the manager of the associated project.
[IMP] There is a new domain on the resolution field, allow to select the project.task.type associated to the selected project. [IMP] The assigned_to field is the connected user, but can be changed by the user bzr revid: stephane@openerp.com-20110224160953-fv9p2qhkqdseh183
This commit is contained in:
@@ -26,6 +26,10 @@ from datetime import datetime, date
|
||||
from tools.translate import _
|
||||
from osv import fields, osv
|
||||
|
||||
class project_project(osv.osv):
|
||||
_name = 'project.project'
|
||||
|
||||
project_project()
|
||||
|
||||
class project_task_type(osv.osv):
|
||||
_name = 'project.task.type'
|
||||
@@ -35,6 +39,7 @@ class project_task_type(osv.osv):
|
||||
'name': fields.char('Stage Name', required=True, size=64, translate=True),
|
||||
'description': fields.text('Description'),
|
||||
'sequence': fields.integer('Sequence'),
|
||||
'project_ids': fields.many2many('project.project', 'project_task_type_rel', 'type_id', 'project_id', 'Projects'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
|
||||
@@ -45,7 +45,7 @@ class project_issue(crm.crm_case, osv.osv):
|
||||
_description = "Project Issue"
|
||||
_order = "priority, id desc"
|
||||
_inherit = ['mailgate.thread']
|
||||
|
||||
|
||||
def case_open(self, cr, uid, ids, *args):
|
||||
"""
|
||||
@param self: The object pointer
|
||||
@@ -175,7 +175,7 @@ class project_issue(crm.crm_case, osv.osv):
|
||||
'section_id': fields.many2one('crm.case.section', 'Sales Team', \
|
||||
select=True, help='Sales team to which Case belongs to.\
|
||||
Define Responsible user and Email account for mail gateway.'),
|
||||
'user_id': fields.many2one('res.users', 'Responsible'),
|
||||
'user_id': fields.related('project_id', 'user_id', type='many2one', relation='res.users', store=True, select=1, string='Responsible'),
|
||||
'partner_id': fields.many2one('res.partner', 'Partner'),
|
||||
'partner_address_id': fields.many2one('res.partner.address', 'Partner Contact', \
|
||||
domain="[('partner_id','=',partner_id)]"),
|
||||
@@ -200,7 +200,7 @@ class project_issue(crm.crm_case, osv.osv):
|
||||
'partner_name': fields.char("Employee's Name", size=64),
|
||||
'partner_mobile': fields.char('Mobile', size=32),
|
||||
'partner_phone': fields.char('Phone', size=32),
|
||||
'type_id': fields.many2one ('project.task.type', 'Resolution'),
|
||||
'type_id': fields.many2one ('project.task.type', 'Resolution', domain="[('project_ids', '=', project_id)]"),
|
||||
'project_id':fields.many2one('project.project', 'Project'),
|
||||
'duration': fields.float('Duration'),
|
||||
'task_id': fields.many2one('project.task', 'Task', domain="[('project_id','=',project_id)]"),
|
||||
@@ -208,7 +208,7 @@ class project_issue(crm.crm_case, osv.osv):
|
||||
method=True, multi='day_open', type="float", store=True),
|
||||
'day_close': fields.function(_compute_day, string='Days to Close', \
|
||||
method=True, multi='day_close', type="float", store=True),
|
||||
'assigned_to': fields.related('task_id', 'user_id', string = 'Assigned to', type="many2one", relation="res.users", store=True, help='This is the current user to whom the related task have been assigned'),
|
||||
'assigned_to': fields.many2one('res.users', 'Assigned to', required=True, select=1),
|
||||
'working_hours_open': fields.function(_compute_day, string='Working Hours to Open the Issue', \
|
||||
method=True, multi='working_days_open', type="float", store=True),
|
||||
'working_hours_close': fields.function(_compute_day, string='Working Hours to Close the Issue', \
|
||||
@@ -241,6 +241,7 @@ class project_issue(crm.crm_case, osv.osv):
|
||||
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.helpdesk', context=c),
|
||||
'priority': crm.AVAILABLE_PRIORITIES[2][0],
|
||||
'project_id':_get_project,
|
||||
'assigned_to' : lambda obj, cr, uid, context: uid,
|
||||
}
|
||||
|
||||
def convert_issue_task(self, cr, uid, ids, context=None):
|
||||
|
||||
@@ -52,13 +52,14 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Issue Tracker Form">
|
||||
<group colspan="4" col="6">
|
||||
<field name="name"/>
|
||||
<field name="project_id" required="True"/>
|
||||
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'project.issue')]"/>
|
||||
<field name="user_id"/>
|
||||
<field name="assigned_to" />
|
||||
<field name="name"/>
|
||||
<field name="project_id" required="True"/>
|
||||
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'project.issue')]"/>
|
||||
<field name="user_id" invisible="1" />
|
||||
<field name="assigned_to"/>
|
||||
<field name="version_id" colspan="2" widget="selection"/>
|
||||
<group colspan="2" col="4">
|
||||
<field name="type_id" readonly="1"/>
|
||||
<field name="type_id" string="Resolution" />
|
||||
<button name="prev_type" string="Previous" type="object" icon="gtk-go-back" help="Change to Previous Stage"/>
|
||||
<button name="next_type" string="Next" type="object" icon="gtk-go-forward" help="Change to Next Stage"/>
|
||||
</group>
|
||||
@@ -73,7 +74,6 @@
|
||||
</group>
|
||||
<group col="3" colspan="2">
|
||||
<separator colspan="3" string="Status"/>
|
||||
<field name="version_id" colspan="3" widget="selection"/>
|
||||
<field name="priority" colspan="3"/>
|
||||
<field name="task_id" on_change="onchange_task_id(task_id)"/>
|
||||
<button string="Convert To Task" name="convert_issue_task" icon="gtk-index" type="object"
|
||||
@@ -184,11 +184,10 @@
|
||||
<field name="partner_id" groups="base.group_extended"/>
|
||||
<field name="project_id" />
|
||||
<field name="priority" string="Priority"/>
|
||||
<field name="type_id" widget="selection" readonly="1"/>
|
||||
<field name="type_id" widget="selection" readonly="1" string="Resolution" />
|
||||
<button name="prev_type" string="Previous" type="object" icon="gtk-go-back" help="Change to Previous Stage"/>
|
||||
<button name="next_type" string="Next" type="object" icon="gtk-go-forward" help="Change to Next Stage"/>
|
||||
<field name="version_id" widget="selection"/>
|
||||
<field name="user_id"/>
|
||||
<field name="assigned_to"/>
|
||||
<field name="progress" widget="progressbar" attrs="{'invisible':[('task_id','=',False)]}"/>
|
||||
<field name="state"/>
|
||||
@@ -218,8 +217,8 @@
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="partner_id" groups="base.group_extended"/>
|
||||
<field name="user_id">
|
||||
<filter domain="[('user_id','=',False)]" help="Unassigned Issues" icon="terp-personal-" separator="1"/>
|
||||
<field name="assigned_to">
|
||||
<filter domain="[('assigned_to','=',False)]" help="Unassigned Issues" icon="terp-personal-" separator="1"/>
|
||||
</field>
|
||||
<field name="project_id"/>
|
||||
</group>
|
||||
@@ -233,7 +232,7 @@
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." groups="base.group_extended">
|
||||
<filter string="Responsible" icon="terp-personal"
|
||||
domain="[]" context="{'group_by':'user_id'}" />
|
||||
domain="[]" context="{'group_by':'assigned_to'}" />
|
||||
<filter string="Partner" icon="terp-partner" domain="[]"
|
||||
context="{'group_by':'partner_id'}" />
|
||||
<separator orientation="vertical"/>
|
||||
@@ -264,7 +263,7 @@
|
||||
<field name="type">calendar</field>
|
||||
<field name="priority" eval="2"/>
|
||||
<field name="arch" type="xml">
|
||||
<calendar string="Issues" date_start="date" color="user_id" date_delay="duration">
|
||||
<calendar string="Issues" date_start="date" color="assigned_to" date_delay="duration">
|
||||
<field name="name"/>
|
||||
<field name="partner_id"/>
|
||||
</calendar>
|
||||
@@ -285,11 +284,11 @@
|
||||
<field name="name" string="Feature description"/>
|
||||
<field name="partner_id" groups="base.group_extended"/>
|
||||
<field name="priority" string="Priority"/>
|
||||
<field name="type_id" widget="selection" readonly="1"/>
|
||||
<button name="prev_type" string="Previous" type="object" icon="gtk-go-back" help="Change to Previous Stage"/>
|
||||
<button name="next_type" string="Next" type="object" icon="gtk-go-forward" help="Change to Next Stage"/>
|
||||
<field name="type_id" widget="selection" readonly="1"/>
|
||||
<button name="prev_type" string="Previous" type="object" icon="gtk-go-back" help="Change to Previous Stage"/>
|
||||
<button name="next_type" string="Next" type="object" icon="gtk-go-forward" help="Change to Next Stage"/>
|
||||
<field name="version_id"/>
|
||||
<field name="user_id"/>
|
||||
<field name="assigned_to"/>
|
||||
<field name="state"/>
|
||||
<button name="case_cancel" string="Cancel" states="draft,open,pending" type="object" icon="gtk-cancel"/>
|
||||
<button name="case_close" string="Done" states="open,draft,pending" type="object" icon="gtk-jump-to"/>
|
||||
@@ -312,7 +311,7 @@
|
||||
<separator orientation="vertical"/>
|
||||
<group>
|
||||
<field name="name" select='1' string="Feature description"/>
|
||||
<field name="user_id" select="1"/>
|
||||
<field name="assigned_to" select="1"/>
|
||||
<field name="state" select="1">
|
||||
<filter icon="terp-check" domain="[('state','in',('open','draft'))]" help="Current Features" name="current_feature"/>
|
||||
<filter icon="terp-camera_test" domain="[('state','=','open')]" help="Open Features"/>
|
||||
|
||||
Reference in New Issue
Block a user