[IMP] crm_project: improve issue view
bzr revid: hmo@tinyerp.com-20100216113641-ivmzprgo45lb2fjb
This commit is contained in:
@@ -38,18 +38,27 @@
|
||||
<group colspan="4" col="6">
|
||||
<field name="name" string="Title" colspan="2"/>
|
||||
<field name="project_id" required="True"/>
|
||||
<field name="task_id"/>
|
||||
</group>
|
||||
<group colspan="4" col="5">
|
||||
<label string="" colspan="2"/>
|
||||
<!-- <button string="Convert To Feature Requests"-->
|
||||
<!-- name="convert_to_feature"-->
|
||||
<!-- icon="gtk-convert" type="object" />-->
|
||||
<button string="Convert To Task"
|
||||
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.project.bug')]"/>
|
||||
<group col="3" colspan="2">
|
||||
<field name="task_id"/>
|
||||
<button string="Convert To Task"
|
||||
name="%(wizard_crm_bug_task_set)d"
|
||||
icon="gtk-index" type="action"
|
||||
attrs="{'invisible':[('task_id','!=',False)]}" />
|
||||
</group>
|
||||
|
||||
</group>
|
||||
<!-- <group colspan="4" col="5">
|
||||
<label string="" colspan="2"/>
|
||||
<button string="Convert To Feature Request"
|
||||
name="convert_to_feature"
|
||||
icon="gtk-convert" type="object" attrs="{'invisible':[('categ_id','=',ref('bug_categ'))]}"/>
|
||||
<button string="Convert To Bug"
|
||||
name="convert_to_bug"
|
||||
icon="gtk-convert" type="object" attrs="{'invisible':[('categ_id','=',ref('feature_request_categ'))]}"/>
|
||||
|
||||
|
||||
</group> -->
|
||||
|
||||
<notebook colspan="4">
|
||||
<page string="General">
|
||||
@@ -82,7 +91,7 @@
|
||||
<button name="case_reset" string="Reset to Draft" states="done,cancel" type="object" icon="gtk-convert"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="History">
|
||||
<page string="History" groups="base.group_extended">
|
||||
<field name="id" select="1"/>
|
||||
<field name="active" />
|
||||
<separator colspan="4" string="Dates"/>
|
||||
@@ -106,7 +115,7 @@
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Emails">
|
||||
<page string="Emails" groups="base.group_extended">
|
||||
<group colspan="4">
|
||||
<field colspan="4" name="email_cc" string="CC"/>
|
||||
</group>
|
||||
@@ -146,8 +155,7 @@
|
||||
<field name="id"/>
|
||||
<field name="name" string="Title"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="priority" string="Severity"/>
|
||||
<field name="categ_id"/>
|
||||
<field name="priority" string="Severity"/>
|
||||
<field name="stage_id" string="Resolution"/>
|
||||
<field name="type_id" string="Version"/>
|
||||
<field name="user_id"/>
|
||||
|
||||
@@ -69,14 +69,23 @@ class crm_project_bug(osv.osv):
|
||||
user = self.pool.get('res.users').browse(cr,uid,uid, context=context)
|
||||
if user.context_project_id:
|
||||
return user.context_project_id
|
||||
return False
|
||||
return False
|
||||
|
||||
def _convert(self, cr, uid, ids, xml_id, context=None):
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
id2 = data_obj._get_id(cr, uid, 'crm_project', xml_id)
|
||||
categ_id = False
|
||||
if id2:
|
||||
categ_id = data_obj.browse(cr, uid, id2, context=context).res_id
|
||||
if categ_id:
|
||||
self.write(cr, uid, ids, {'categ_id': categ_id})
|
||||
return True
|
||||
|
||||
def convert_to_feature(self, cr, uid, ids, context=None):
|
||||
categ_obj = self.pool.get('crm.case.categ')
|
||||
categ_id = categ_obj.search(cr, uid, [('name', 'ilike', 'feature%')])
|
||||
for id in ids:
|
||||
self.write(cr, uid, id, {'categ_id': categ_id and categ_id[0] or False})
|
||||
return True
|
||||
return self._convert(cr, uid, ids, 'feature_request_categ', context=context)
|
||||
|
||||
def convert_to_bug(self, cr, uid, ids, context=None):
|
||||
return self._convert(cr, uid, ids, 'bug_categ', context=context)
|
||||
|
||||
_defaults = {
|
||||
'project_id':_get_project,
|
||||
|
||||
Reference in New Issue
Block a user