From 0129ecbcf76f5a2076ddf9278fda4e23b70b175e Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Tue, 9 Mar 2010 10:56:19 +0100 Subject: [PATCH] [IMP] project issue form bzr revid: fp@tinyerp.com-20100309095619-r2d676mg94jhsc1u --- addons/crm/crm.py | 3 +- addons/project_issue/project_issue.py | 28 +-- addons/project_issue/project_issue_view.xml | 188 +++++++++----------- 3 files changed, 98 insertions(+), 121 deletions(-) diff --git a/addons/crm/crm.py b/addons/crm/crm.py index 8bc6f56117d..ce318aeca4f 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -224,6 +224,7 @@ class crm_case(osv.osv): 'email_from': fields.char('Email', size=128, help="These people will receive email."), 'email_cc': fields.text('Watchers Emails', size=252 , help="These people will receive a copy of the future" \ " communication between partner and users by email"), + 'probability': fields.float('Probability'), 'email_last': fields.function(_email_last, method=True, string='Latest E-Mail', type='text'), 'partner_id': fields.many2one('res.partner', 'Partner'), @@ -318,7 +319,7 @@ class crm_case(osv.osv): if section in s: st = case.stage_id.id or False s[section] = dict([(v, k) for (k, v) in s[section].iteritems()]) - if st in s[section]: + if st and st in s[section]: stage_value = self.pool.get('crm.case.stage').read(cr, uid,s[section][st] ,['probability'], context) self.write(cr, uid, [case.id], {'stage_id': s[section][st],'probability':stage_value['probability']}) return True diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index f0441c0263c..48492f44675 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -29,10 +29,8 @@ from tools.translate import _ import tools from osv import fields,osv,orm from osv.orm import except_orm - from crm import crm - class project_issue(osv.osv): _name = "project.issue" _description = "Project Issue" @@ -45,30 +43,22 @@ class project_issue(osv.osv): 'ref2' : fields.reference('Reference 2', selection=crm._links_get, size=128), 'canal_id': fields.many2one('res.partner.canal', 'Channel',help="The channels represent the different communication modes available with the customer." \ " With each commercial opportunity, you can indicate the canall which is this opportunity source."), - 'planned_revenue': fields.float('Planned Revenue'), - 'planned_cost': fields.float('Planned Costs'), - 'som': fields.many2one('res.partner.som', 'State of Mind', help="The minds states allow to define a value scale which represents" \ - "the partner mentality in relation to our services.The scale has" \ - "to be created with a factor for each level from 0 (Very dissatisfied) to 10 (Extremely satisfied)."), 'categ_id': fields.many2one('crm.case.categ','Category', domain="[('object_id.model', '=', 'crm.project.bug')]"), - 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'), - 'type_id': fields.many2one('crm.case.resource.type', 'Bug Type', domain="[('object_id.model', '=', 'project.issue')]"), - + 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Severity'), + 'type_id': fields.many2one('crm.case.resource.type', 'Version', domain="[('object_id.model', '=', 'project.issue')]"), 'partner_name': fields.char("Employee's Name", size=64), 'partner_mobile': fields.char('Mobile', size=32), 'partner_phone': fields.char('Phone', size=32), 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('object_id.model', '=', 'project.issue')]"), 'project_id':fields.many2one('project.project', 'Project'), 'duration': fields.float('Duration'), - 'probability': fields.float('Probability (%)'), 'task_id': fields.many2one('project.task', 'Task', domain="[('project_id','=',project_id)]") } - def _get_project(self, cr, uid, context): 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') @@ -79,7 +69,7 @@ class project_issue(osv.osv): if categ_id: self.write(cr, uid, ids, {'categ_id': categ_id}) return True - + def convert_to_feature(self, cr, uid, ids, context=None): return self._convert(cr, uid, ids, 'feature_request_categ', context=context) @@ -92,14 +82,10 @@ class project_issue(osv.osv): stage = self.pool.get('crm.case.stage').browse(cr, uid, stage_id, context) if not stage.on_change: return {'value':{}} - return {'value':{'probability':stage.probability}} + return {'value':{}} _defaults = { - 'project_id':_get_project, - 'probability':lambda *a:0.0, - 'planned_cost':lambda *a:0.0, - 'planned_revenue':lambda *a:0.0, - } - + 'project_id':_get_project, + } project_issue() diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml index 305db272f4c..2a82ef783d3 100644 --- a/addons/project_issue/project_issue_view.xml +++ b/addons/project_issue/project_issue_view.xml @@ -11,22 +11,22 @@ Issue Categories crm.case.categ form - - [('object_id.model', '=', 'project.issue')] - {'object_id':'project.issue'} + + [('object_id.model', '=', 'project.issue')] + {'object_id':'project.issue'} # ------------------------------------------------------ - # Stage - # ------------------------------------------------------ - - Issue Stages - crm.case.stage - form - - [('object_id.model', '=', 'project.issue')] - {'object_id':'project.issue'} - - + # Stage + # ------------------------------------------------------ + + Issue Stages + crm.case.stage + form + + [('object_id.model', '=', 'project.issue')] + {'object_id':'project.issue'} + + Project Issue Tracker Form @@ -34,50 +34,38 @@ form
- - - + + + + - - -