From 92b81da2e174bc41de31f6f2986d560426e1c26c Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Mon, 18 Jan 2010 15:33:52 +0530 Subject: [PATCH 01/13] [IMP]: Create one object of type,category,stage for all crm case objects bzr revid: sbh@tinyerp.com-20100118100352-jdlv6dejcwh05tuc --- addons/crm/crm.py | 42 ++++++++++++++ addons/crm/crm_claim.py | 43 +------------- addons/crm/crm_claims_data.xml | 30 ++++++---- addons/crm/crm_claims_view.xml | 18 ++++-- addons/crm/crm_fund_data.xml | 26 ++++++--- addons/crm/crm_fund_view.xml | 19 ++++--- addons/crm/crm_fundraising.py | 46 ++------------- addons/crm/crm_helpdesk.py | 15 +---- addons/crm/crm_helpdesk_view.xml | 7 ++- addons/crm/crm_lead.py | 42 +------------- addons/crm/crm_lead_data.xml | 63 ++++++++++++++------- addons/crm/crm_lead_view.xml | 18 ++++-- addons/crm/crm_meeting.py | 33 +---------- addons/crm/crm_meeting_data.xml | 10 +++- addons/crm/crm_opportunity.py | 43 +------------- addons/crm/crm_opportunity_data.xml | 53 +++++++++++------ addons/crm/crm_opportunity_view.xml | 18 ++++-- addons/crm/crm_phonecall.py | 35 +++--------- addons/crm/crm_phonecall_data.xml | 16 ++++-- addons/crm/crm_phonecall_view.xml | 18 ++++-- addons/crm/crm_view.xml | 4 +- addons/crm/wizard/crm_opportunity_wizard.py | 6 +- 22 files changed, 267 insertions(+), 338 deletions(-) diff --git a/addons/crm/crm.py b/addons/crm/crm.py index 53173754b8e..b42b7e3a6ed 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -101,6 +101,48 @@ class crm_case_section(osv.osv): return res crm_case_section() +class crm_case_categ(osv.osv): + _name = "crm.case.categ" + _description = "Category of case" + _columns = { + 'name': fields.char('Case Category Name', size=64, required=True, translate=True), + 'probability': fields.float('Probability (%)', required=True), + 'section_id': fields.many2one('crm.case.section', 'Case Section'), + 'object_id': fields.many2one('ir.model','Object Name'), + } + _defaults = { + 'probability': lambda *args: 0.0 + } +crm_case_categ() + +class crm_case_resource_type(osv.osv): + _name = "crm.case.resource.type" + _description = "Resource Type of case" + _rec_name = "name" + _columns = { + 'name': fields.char('Case Resource Type', size=64, required=True, translate=True), + 'section_id': fields.many2one('crm.case.section', 'Case Section'), + 'object_id': fields.many2one('ir.model','Object Name'), + } + +crm_case_resource_type() + + +class crm_case_stage(osv.osv): + _name = "crm.case.stage" + _description = "Stage of case" + _rec_name = 'name' + _order = "sequence" + _columns = { + 'name': fields.char('Stage Name', size=64, required=True, translate=True), + 'section_id': fields.many2one('crm.case.section', 'Case Section'), + 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of case stages."), + 'object_id': fields.many2one('ir.model','Object Name'), + } + _defaults = { + 'sequence': lambda *args: 1 + } +crm_case_stage() class crm_case_rule(osv.osv): diff --git a/addons/crm/crm_claim.py b/addons/crm/crm_claim.py index 693e5aa1a22..5f278ba9dca 100644 --- a/addons/crm/crm_claim.py +++ b/addons/crm/crm_claim.py @@ -27,44 +27,7 @@ import netsvc from tools.translate import _ import crm -class crm_claim_categ(osv.osv): - _name = "crm.claim.categ" - _description = "Claim Categories" - _columns = { - 'name': fields.char('Category Name', size=64, required=True), - 'probability': fields.float('Probability (%)', required=True), - 'section_id': fields.many2one('crm.case.section', 'Case Section'), - } - _defaults = { - 'probability': lambda *args: 0.0 - } -crm_claim_categ() -class crm_claim_type(osv.osv): - _name = "crm.claim.type" - _description = "Claim Type" - _rec_name = "name" - _columns = { - 'name': fields.char('Claim Type Name', size=64, required=True, translate=True), - 'section_id': fields.many2one('crm.case.section', 'Case Section'), - } - -crm_claim_type() - -class crm_claim_stage(osv.osv): - _name = "crm.claim.stage" - _description = "Stage of claim case" - _rec_name = 'name' - _order = "sequence" - _columns = { - 'name': fields.char('Stage Name', size=64, required=True, translate=True), - 'section_id': fields.many2one('crm.case.section', 'Case Section'), - 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of case stages."), - } - _defaults = { - 'sequence': lambda *args: 1 - } -crm_claim_stage() class crm_claim(osv.osv): _name = "crm.claim" @@ -82,14 +45,14 @@ class crm_claim(osv.osv): '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.claim.categ','Category', domain="[('section_id','=',section_id)]"), + 'categ_id': fields.many2one('crm.case.categ','Category', domain="[('section_id','=',section_id)]"), 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'), - 'type_id': fields.many2one('crm.claim.type', 'Claim Type', domain="[('section_id','=',section_id)]"), + 'type_id': fields.many2one('crm.case.resource.type', 'Claim Type', domain="[('section_id','=',section_id)]"), '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.claim.stage', 'Stage', domain="[('section_id','=',section_id)]"), + 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id)]"), } _defaults = { diff --git a/addons/crm/crm_claims_data.xml b/addons/crm/crm_claims_data.xml index 9566e28f52a..f9388e06daf 100644 --- a/addons/crm/crm_claims_data.xml +++ b/addons/crm/crm_claims_data.xml @@ -5,53 +5,63 @@ - + Factual Claims + - + Value Claims + - + Policy Claims + - + Corrective + - + Preventive + - + Accepted as Claim + - + Fixed + - + Won't fix + - + Invalid + - + Awaiting Response + \ No newline at end of file diff --git a/addons/crm/crm_claims_view.xml b/addons/crm/crm_claims_view.xml index ec7568d1aa3..8a93e5dd433 100644 --- a/addons/crm/crm_claims_view.xml +++ b/addons/crm/crm_claims_view.xml @@ -9,34 +9,37 @@ crm.claim.categ.form - crm.claim.categ + crm.case.categ form
+
crm.claim.categ.tree - crm.claim.categ + crm.case.categ tree + Claim Categories - crm.claim.categ + crm.case.categ form + [('object_id.model', '=', 'crm.claim')] # ------------------------------------------------------ @@ -44,33 +47,36 @@ # ------------------------------------------------------ crm.claim.stage.tree - crm.claim.stage + crm.case.stage tree + crm.claim.stage.form - crm.claim.stage + crm.case.stage form
+
Claim Stages - crm.claim.stage + crm.case.stage form + [('object_id.model', '=', 'crm.claim')] diff --git a/addons/crm/crm_fund_data.xml b/addons/crm/crm_fund_data.xml index 08b8d71e5bb..1c566279b90 100644 --- a/addons/crm/crm_fund_data.xml +++ b/addons/crm/crm_fund_data.xml @@ -4,46 +4,54 @@ - + Social Rehabilitation And Rural Upliftment + - + Learning And Education + - + Healthcare + - + Arts And Culture + - + - + Cash + - + Cheque + - + Credit Card + - + Demand Draft + diff --git a/addons/crm/crm_fund_view.xml b/addons/crm/crm_fund_view.xml index 2ef4c98ea6f..12566104da9 100644 --- a/addons/crm/crm_fund_view.xml +++ b/addons/crm/crm_fund_view.xml @@ -7,34 +7,36 @@ # ------------------------------------------------------ crm.fundraising.categ.form - crm.fundraising.categ + crm.case.categ form
+
crm.fundraising.categ.tree - crm.fundraising.categ + crm.case.categ tree - + Fundraising Categories - crm.fundraising.categ + crm.case.categ form + [('object_id.model', '=', 'crm.fundraising')] # ------------------------------------------------------ @@ -42,33 +44,36 @@ # ------------------------------------------------------ crm.fundraising.stage.tree - crm.fundraising.stage + crm.case.resourcestage tree + crm.fundraising.stage.form - crm.fundraising.stage + crm.case.stage form
+
Fundraising Stages - crm.claim.stage + crm.case.stage form + [('object_id.model', '=', 'crm.fundraising')] diff --git a/addons/crm/crm_fundraising.py b/addons/crm/crm_fundraising.py index 30c01d5de2f..ba69b092df2 100644 --- a/addons/crm/crm_fundraising.py +++ b/addons/crm/crm_fundraising.py @@ -34,44 +34,6 @@ from osv.orm import except_orm import crm -class crm_fundraising_categ(osv.osv): - _name = "crm.fundraising.categ" - _description = "Fundraising Categories" - _columns = { - 'name': fields.char('Category Name', size=64, required=True), - 'probability': fields.float('Probability (%)', required=True), - 'section_id': fields.many2one('crm.case.section', 'Case Section'), - } - _defaults = { - 'probability': lambda *args: 0.0 - } -crm_fundraising_categ() - -class crm_fundraising_type(osv.osv): - _name = "crm.fundraising.type" - _description = "Fundraising Type" - _rec_name = "name" - _columns = { - 'name': fields.char('Fundraising Type Name', size=64, required=True, translate=True), - 'section_id': fields.many2one('crm.case.section', 'Case Section'), - } - -crm_fundraising_type() - -class crm_fundraising_stage(osv.osv): - _name = "crm.fundraising.stage" - _description = "Stage of fundraising case" - _rec_name = 'name' - _order = "sequence" - _columns = { - 'name': fields.char('Stage Name', size=64, required=True, translate=True), - 'section_id': fields.many2one('crm.case.section', 'Case Section'), - 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of case stages."), - } - _defaults = { - 'sequence': lambda *args: 1 - } -crm_fundraising_stage() class crm_fundraising(osv.osv): @@ -82,7 +44,7 @@ class crm_fundraising(osv.osv): _columns = { 'date_closed': fields.datetime('Closed', readonly=True), 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'), - 'categ_id': fields.many2one('crm.fundraising.categ','Category', domain="[('section_id','=',section_id)]"), + 'categ_id': fields.many2one('crm.case.categ','Category', domain="[('section_id','=',section_id)]"), 'planned_revenue': fields.float('Planned Revenue'), 'planned_cost': fields.float('Planned Costs'), 'probability': fields.float('Probability (%)'), @@ -90,8 +52,8 @@ class crm_fundraising(osv.osv): 'partner_name2': fields.char('Employee Email', size=64), 'partner_phone': fields.char('Phone', size=32), 'partner_mobile': fields.char('Mobile', size=32), - 'stage_id': fields.many2one ('crm.fundraising.stage', 'Stage', domain="[('section_id','=',section_id)]"), - 'type_id': fields.many2one('crm.fundraising.type', 'Fundraising Type', domain="[('section_id','=',section_id)]"), + 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id)]"), + 'type_id': fields.many2one('crm.case.resource.type', 'Fundraising Type', domain="[('section_id','=',section_id)]"), 'duration': fields.float('Duration'), 'ref' : fields.reference('Reference', selection=crm._links_get, size=128), 'ref2' : fields.reference('Reference 2', selection=crm._links_get, size=128), @@ -108,7 +70,7 @@ class crm_fundraising(osv.osv): def onchange_categ_id(self, cr, uid, ids, categ, context={}): if not categ: return {'value':{}} - cat = self.pool.get('crm.fundraising.categ').browse(cr, uid, categ, context).probability + cat = self.pool.get('crm.case.categ').browse(cr, uid, categ, context).probability return {'value':{'probability':cat}} diff --git a/addons/crm/crm_helpdesk.py b/addons/crm/crm_helpdesk.py index cdf6d25f3bf..01239fd780b 100644 --- a/addons/crm/crm_helpdesk.py +++ b/addons/crm/crm_helpdesk.py @@ -34,18 +34,7 @@ from osv.orm import except_orm import crm -class crm_helpdesk_categ(osv.osv): - _name = "crm.helpdesk.categ" - _description = "Helpdesk Categories" - _columns = { - 'name': fields.char('Category Name', size=64, required=True), - 'probability': fields.float('Probability (%)', required=True), - 'section_id': fields.many2one('crm.case.section', 'Case Section'), - } - _defaults = { - 'probability': lambda *args: 0.0 - } -crm_helpdesk_categ() + class crm_helpdesk(osv.osv): _name = "crm.helpdesk" @@ -65,7 +54,7 @@ class crm_helpdesk(osv.osv): '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.helpdesk.categ', 'Category', domain="[('section_id','=',section_id)]"), + 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id)]"), 'duration': fields.float('Duration'), } def onchange_categ_id(self, cr, uid, ids, categ, context={}): diff --git a/addons/crm/crm_helpdesk_view.xml b/addons/crm/crm_helpdesk_view.xml index 25c2d68b787..dc7ba21432b 100644 --- a/addons/crm/crm_helpdesk_view.xml +++ b/addons/crm/crm_helpdesk_view.xml @@ -7,25 +7,27 @@ # ------------------------------------------------------ crm.helpdesk.categ.form - crm.helpdesk.categ + crm.case.categ form
+
crm.helpdesk.categ.tree - crm.helpdesk.categ + crm.case.categ tree + @@ -35,6 +37,7 @@ crm.helpdesk.categ form + [('object_id.model', '=', 'crm.helpdesk')]
# ------------------------------------------------------ diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 9fe1b1c4236..0a22ac1e3ae 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -34,43 +34,7 @@ from osv.orm import except_orm import crm -class crm_lead_categ(osv.osv): - _name = "crm.lead.categ" - _description = "Lead Categories" - _columns = { - 'name': fields.char('Category Name', size=64, required=True), - 'probability': fields.float('Probability (%)', required=True), - 'section_id': fields.many2one('crm.case.section', 'Case Section'), - } - _defaults = { - 'probability': lambda *args: 0.0 - } -crm_lead_categ() -class crm_lead_type(osv.osv): - _name = "crm.lead.type" - _description = "Lead Type" - _rec_name = "name" - _columns = { - 'name': fields.char('lead Type Name', size=64, required=True, translate=True), - 'section_id': fields.many2one('crm.case.section', 'Case Section'), - } -crm_lead_type() - -class crm_lead_stage(osv.osv): - _name = "crm.lead.stage" - _description = "Stage of claim case" - _rec_name = 'name' - _order = "sequence" - _columns = { - 'name': fields.char('Stage Name', size=64, required=True, translate=True), - 'section_id': fields.many2one('crm.case.section', 'Case Section'), - 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of case stages."), - } - _defaults = { - 'sequence': lambda *args: 1 - } -crm_lead_stage() class crm_opportunity(osv.osv): _name = "crm.opportunity" crm_opportunity() @@ -81,8 +45,8 @@ class crm_lead(osv.osv): _order = "id desc" _inherit = 'crm.case' _columns = { - 'categ_id': fields.many2one('crm.lead.categ', 'Category', domain="[('section_id','=',section_id)]"), - 'type_id': fields.many2one('crm.lead.type', 'Lead Type Name', domain="[('section_id','=',section_id)]"), + 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id)]"), + 'type_id': fields.many2one('crm.case.resource.type', 'Lead Type Name', domain="[('section_id','=',section_id)]"), 'partner_name': fields.char("Employee's Name", size=64), 'partner_name2': fields.char('Employee Email', size=64), 'partner_phone': fields.char('Phone', size=32), @@ -96,7 +60,7 @@ class crm_lead(osv.osv): " 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'), - 'stage_id': fields.many2one ('crm.lead.stage', 'Stage', domain="[('section_id','=',section_id)]"), + 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id)]"), '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)."), diff --git a/addons/crm/crm_lead_data.xml b/addons/crm/crm_lead_data.xml index bb232abfa52..6f142391d28 100644 --- a/addons/crm/crm_lead_data.xml +++ b/addons/crm/crm_lead_data.xml @@ -2,93 +2,114 @@ - + Existing Customer + - + Self Generated + - + Employee + - + Partner + - + Website + - + Word of mouth + - + Other + - + New + - + Assigned + - + In Process + - + Converted + - + Recycled + - + Dead + - + Telesales + - + Mail + - + Email + - + Print + - + Web + - + Radio + - + Television + - + Newsletter + diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 98e8a365dc7..ea060fb22d4 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -8,34 +8,37 @@ crm.lead.categ.form - crm.lead.categ + crm.case.categ form
+
crm.lead.categ.tree - crm.lead.categ + crm.case.categ tree + Lead Categories - crm.lead.categ + crm.case.categ form + [('object_id.model', '=', 'crm.lead')] @@ -44,33 +47,36 @@ # ------------------------------------------------------ crm.lead.stage.tree - crm.lead.stage + crm.case.stage tree + crm.lead.stage.form - crm.lead.stage + crm.case.stage form
+
Lead Stages - crm.claim.stage + crm.case.stage form + [('object_id.model', '=', 'crm.lead')] # ------------------------------------------------------ diff --git a/addons/crm/crm_meeting.py b/addons/crm/crm_meeting.py index 848b8d819fa..fcf16d3ec25 100644 --- a/addons/crm/crm_meeting.py +++ b/addons/crm/crm_meeting.py @@ -29,19 +29,6 @@ import re import time import tools -class crm_meeting_categ(osv.osv): - _name = "crm.meeting.categ" - _description = "Category of Meetings" - _columns = { - 'name': fields.char('Meeting Category Name', size=64, required=True, \ - translate=True), - 'probability': fields.float('Probability (%)', required=True), - 'section_id': fields.many2one('crm.case.section', 'Case Section'), - } - _defaults = { - 'probability': lambda *args: 0.0 - } -crm_meeting_categ() class crm_meeting(osv.osv): _name = 'crm.meeting' @@ -127,7 +114,7 @@ account for mail gateway.'), 'date_deadline': fields.datetime('Deadline'), 'duration': fields.function(_get_duration, method=True, \ fnct_inv=_set_duration, string='Duration'), - 'categ_id': fields.many2one('crm.meeting.categ', 'Category', \ + 'categ_id': fields.many2one('crm.case.categ', 'Category', \ domain="[('section_id','=',section_id)]", \ help='Category related to the section.Subdivide the CRM cases \ independently or section-wise.'), @@ -382,24 +369,6 @@ rule or repeating pattern for anexception to a recurrence set"), alarm_obj.do_alarm_create(cr, uid, [res], self._name, 'date') return res - - def msg_new(self, cr, uid, msg): - mailgate_obj = self.pool.get('mail.gateway') - msg_body = mailgate_obj.msg_body_get(msg) - data = { - 'name': msg['Subject'], - 'email_from': msg['From'], - 'email_cc': msg['Cc'], - 'user_id': False, - 'description': msg_body['body'], - 'history_line': [(0, 0, {'description': msg_body['body'], 'email': msg['From'] })], - } - res = mailgate_obj.partner_get(cr, uid, msg['From']) - if res: - data.update(res) - res = self.create(cr, uid, data) - return res - crm_meeting() class res_users(osv.osv): diff --git a/addons/crm/crm_meeting_data.xml b/addons/crm/crm_meeting_data.xml index 1d727a72223..22b6d9ed29c 100644 --- a/addons/crm/crm_meeting_data.xml +++ b/addons/crm/crm_meeting_data.xml @@ -4,22 +4,26 @@ - + Customer Meeting + - + Internal Meeting + - + Phone Call + Case Meeting crm.meeting + diff --git a/addons/crm/crm_opportunity.py b/addons/crm/crm_opportunity.py index d0db5e3d614..684479584d9 100644 --- a/addons/crm/crm_opportunity.py +++ b/addons/crm/crm_opportunity.py @@ -34,43 +34,6 @@ from osv.orm import except_orm import crm -class crm_opportunity_categ(osv.osv): - _name = "crm.opportunity.categ" - _description = "Opportunity Categories" - _columns = { - 'name': fields.char('Category Name', size=64, required=True), - 'probability': fields.float('Probability (%)', required=True), - 'section_id': fields.many2one('crm.case.section', 'Case Section'), - } - _defaults = { - 'probability': lambda *args: 0.0 - } -crm_opportunity_categ() - -class crm_opportunity_type(osv.osv): - _name = "crm.opportunity.type" - _description = "Opportunity Type" - _rec_name = "name" - _columns = { - 'name': fields.char('lead Type Name', size=64, required=True, translate=True), - 'section_id': fields.many2one('crm.case.section', 'Case Section'), - } -crm_opportunity_type() - -class crm_opportunity_stage(osv.osv): - _name = "crm.opportunity.stage" - _description = "Stage of opportunity case" - _rec_name = 'name' - _order = "sequence" - _columns = { - 'name': fields.char('Stage Name', size=64, required=True, translate=True), - 'section_id': fields.many2one('crm.case.section', 'Case Section'), - 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of case stages."), - } - _defaults = { - 'sequence': lambda *args: 1 - } -crm_opportunity_stage() class crm_opportunity(osv.osv): _name = "crm.opportunity" @@ -78,9 +41,9 @@ class crm_opportunity(osv.osv): _order = "id desc" _inherit = 'crm.case' _columns = { - 'stage_id': fields.many2one ('crm.opportunity.stage', 'Stage', domain="[('section_id','=',section_id)]"), - 'categ_id': fields.many2one('crm.opportunity.categ', 'Category', domain="[('section_id','=',section_id)]"), - 'type_id': fields.many2one('crm.opportunity.type', 'Opportunity Type', domain="[('section_id','=',section_id)]"), + 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id)]"), + 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id)]"), + 'type_id': fields.many2one('crm.case.resource.type', 'Resource Type', domain="[('section_id','=',section_id)]"), 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'), 'probability': fields.float('Probability (%)'), 'planned_revenue': fields.float('Planned Revenue'), diff --git a/addons/crm/crm_opportunity_data.xml b/addons/crm/crm_opportunity_data.xml index bc08064ab92..b3780990a13 100644 --- a/addons/crm/crm_opportunity_data.xml +++ b/addons/crm/crm_opportunity_data.xml @@ -1,77 +1,94 @@ - + Existing Customer + - + Self Generated + - + Employee + - + Partner + - + Campaign + - + Website + - + Word of mouth + - + Other + - + Prospecting + - + Needs Analysis + - + Value Proposition + - + Proposal/Price Quote + - + Negotiation/Review + - + Closed Won + - + Closed Lost + - - + + Existing Business + - + New Business + diff --git a/addons/crm/crm_opportunity_view.xml b/addons/crm/crm_opportunity_view.xml index 4a0273c372a..c5874b08a83 100644 --- a/addons/crm/crm_opportunity_view.xml +++ b/addons/crm/crm_opportunity_view.xml @@ -8,34 +8,37 @@ crm.opportunity.categ.form - crm.opportunity.categ + crm.case.categ form
+
crm.opportunity.categ.tree - crm.opportunity.categ + crm.case.categ tree + Opportunity Categories - crm.opportunity.categ + crm.case.categ form + [('object_id.model', '=', 'crm.opportunity')] # ------------------------------------------------------ @@ -43,25 +46,27 @@ # ------------------------------------------------------ crm.opportunity.stage.tree - crm.opportunity.stage + crm.case.stage tree + crm.opportunity.stage.form - crm.opportunity.stage + crm.case.stage form
+ @@ -69,9 +74,10 @@ Opportunity Stages - crm.claim.stage + crm.case.stage form + [('object_id.model', '=', 'crm.opportunity')] # ------------------------------------------------------ diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py index 50db660e1f0..21820b12044 100644 --- a/addons/crm/crm_phonecall.py +++ b/addons/crm/crm_phonecall.py @@ -32,33 +32,6 @@ from tools.translate import _ import crm -class crm_phonecall_categ(osv.osv): - _name = "crm.phonecall.categ" - _description = "Phonecall Categories" - _columns = { - 'name': fields.char('Category Name', size=64, required=True), - 'probability': fields.float('Probability (%)', required=True), - 'section_id': fields.many2one('crm.case.section', 'Case Section'), - } - _defaults = { - 'probability': lambda *args: 0.0 - } -crm_phonecall_categ() - -class crm_phonecall_stage(osv.osv): - _name = "crm.phonecall.stage" - _description = "Stage of phonecal case" - _rec_name = 'name' - _order = "sequence" - _columns = { - 'name': fields.char('Stage Name', size=64, required=True, translate=True), - 'section_id': fields.many2one('crm.case.section', 'Case Section'), - 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of case stages."), - } - _defaults = { - 'sequence': lambda *args: 1 - } -crm_phonecall_stage() class crm_phonecall(osv.osv): _name = "crm.phonecall" @@ -67,7 +40,7 @@ class crm_phonecall(osv.osv): _inherit = 'crm.case' _columns = { 'duration': fields.float('Duration'), - 'categ_id': fields.many2one('crm.phonecall.categ', 'Category', domain="[('section_id','=',section_id)]"), + 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id)]"), 'partner_phone': fields.char('Phone', size=32), 'partner_mobile': fields.char('Mobile', size=32), 'som': fields.many2one('res.partner.som', 'State of Mind', help="The minds states allow to define a value scale which represents" \ @@ -81,6 +54,12 @@ class crm_phonecall(osv.osv): 'date_closed': fields.datetime('Closed', readonly=True), 'opportunity_id':fields.many2one ('crm.opportunity', 'Opportunity'), } + def onchange_categ_id(self, cr, uid, ids, categ, context={}): + if not categ: + return {'value':{}} + cat = self.pool.get('crm.case.categ').browse(cr, uid, categ, context).probability + return {'value':{'probability':cat}} + crm_phonecall() diff --git a/addons/crm/crm_phonecall_data.xml b/addons/crm/crm_phonecall_data.xml index a7444ad0b1e..49d02f8848e 100644 --- a/addons/crm/crm_phonecall_data.xml +++ b/addons/crm/crm_phonecall_data.xml @@ -6,29 +6,35 @@ - + Inbound + + - + Outbound + - + Planned + - + Held + - + Not Held +
\ No newline at end of file diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml index b10ff4fe7db..2a1a3885c2e 100644 --- a/addons/crm/crm_phonecall_view.xml +++ b/addons/crm/crm_phonecall_view.xml @@ -8,34 +8,37 @@ crm.phonecall.categ.form - crm.phonecall.categ + crm.case.categ form
+
crm.phonecall.categ.tree - crm.phonecall.categ + crm.case.categ tree + Phonecall Categories - crm.phonecall.categ + crm.case.categ form + [('object_id.model', '=', 'crm.phonecall')] @@ -44,33 +47,36 @@ # ------------------------------------------------------ crm.phonecall.stage.tree - crm.phonecall.stage + crm.case.stage tree + crm.phonecall.stage.form - crm.phonecall.stage + crm.case.stage form
+
Phonecall Stages - crm.phonecall.stage + crm.case.stage form + [('object_id.model', '=', 'crm.phonecall')] diff --git a/addons/crm/crm_view.xml b/addons/crm/crm_view.xml index b6d16c2fcbd..53d075d2072 100644 --- a/addons/crm/crm_view.xml +++ b/addons/crm/crm_view.xml @@ -47,8 +47,8 @@ form
- - + + diff --git a/addons/crm/wizard/crm_opportunity_wizard.py b/addons/crm/wizard/crm_opportunity_wizard.py index 49ae48f62fa..30a1e817b07 100644 --- a/addons/crm/wizard/crm_opportunity_wizard.py +++ b/addons/crm/wizard/crm_opportunity_wizard.py @@ -48,13 +48,13 @@ class opportunity2phonecall(wizard.interface): 'user_id' : {'string' : 'Assign To', 'type' : 'many2one', 'relation' : 'res.users'}, 'deadline' : {'string' : 'Planned Date', 'type' : 'datetime'}, 'note' : {'string' : 'Goals', 'type' : 'text'}, - 'category_id' : {'string' : 'Category', 'type' : 'many2one', 'relation' : 'crm.phonecall.categ', 'required' :True}, + 'category_id' : {'string' : 'Category', 'type' : 'many2one', 'relation' : 'crm.case.categ', 'required' :True}, 'section_id' : {'string' : 'Section', 'type' : 'many2one', 'relation' : 'crm.case.section'}, } def _default_values(self, cr, uid, data, context): case_obj = pooler.get_pool(cr.dbname).get('crm.opportunity') - categ_id = pooler.get_pool(cr.dbname).get('crm.phonecall.categ').search(cr, uid, [('name','=','Outbound')]) + categ_id = pooler.get_pool(cr.dbname).get('crm.case.categ').search(cr, uid, [('name','=','Outbound')]) case = case_obj.browse(cr, uid, data['id']) return { 'user_id' : case.user_id and case.user_id.id, @@ -203,7 +203,7 @@ class partner_opportunity(wizard.interface): address = part_obj.address_get(cr, uid, data['ids' ]) - categ_obj = pool.get('crm.opportunity.categ') + categ_obj = pool.get('crm.case.categ') categ_ids = categ_obj.search(cr, uid, [('name','ilike','Part%')]) case_obj = pool.get('crm.opportunity') From f1489df74b863c7b4f83f77d900c3c06fb88de63 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Mon, 18 Jan 2010 16:18:23 +0530 Subject: [PATCH 02/13] [Fix]: Fix the problem of model name in case bzr revid: sbh@tinyerp.com-20100118104823-zz9i21fs7jhv4ovl --- addons/crm/crm_claims_view.xml | 6 ++---- addons/crm/crm_fund_view.xml | 6 ++---- addons/crm/crm_helpdesk_view.xml | 4 ++-- addons/crm/crm_lead.py | 1 + addons/crm/crm_lead_view.xml | 6 ++---- addons/crm/crm_opportunity_view.xml | 6 ++---- addons/crm/crm_phonecall_view.xml | 7 +++---- 7 files changed, 14 insertions(+), 22 deletions(-) diff --git a/addons/crm/crm_claims_view.xml b/addons/crm/crm_claims_view.xml index 8a93e5dd433..13408a1092e 100644 --- a/addons/crm/crm_claims_view.xml +++ b/addons/crm/crm_claims_view.xml @@ -16,7 +16,7 @@ - +
@@ -29,7 +29,6 @@ -
@@ -54,7 +53,6 @@ -
@@ -66,7 +64,7 @@
- + diff --git a/addons/crm/crm_fund_view.xml b/addons/crm/crm_fund_view.xml index 12566104da9..f4c956f83e1 100644 --- a/addons/crm/crm_fund_view.xml +++ b/addons/crm/crm_fund_view.xml @@ -14,7 +14,7 @@ - +
@@ -26,7 +26,6 @@ -
@@ -51,7 +50,6 @@ -
@@ -63,7 +61,7 @@
- + diff --git a/addons/crm/crm_helpdesk_view.xml b/addons/crm/crm_helpdesk_view.xml index dc7ba21432b..f45a5c428c1 100644 --- a/addons/crm/crm_helpdesk_view.xml +++ b/addons/crm/crm_helpdesk_view.xml @@ -14,7 +14,7 @@ - +
@@ -27,7 +27,7 @@ - +
diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 0a22ac1e3ae..c62a0fc8ebf 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -37,6 +37,7 @@ import crm class crm_opportunity(osv.osv): _name = "crm.opportunity" + _description = "Opportunity Cases" crm_opportunity() class crm_lead(osv.osv): diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index ea060fb22d4..3dfc8129c6b 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -15,7 +15,7 @@ - +
@@ -28,7 +28,6 @@ -
@@ -54,7 +53,6 @@ -
@@ -66,7 +64,7 @@
- + diff --git a/addons/crm/crm_opportunity_view.xml b/addons/crm/crm_opportunity_view.xml index c5874b08a83..3bbb9d9cc7e 100644 --- a/addons/crm/crm_opportunity_view.xml +++ b/addons/crm/crm_opportunity_view.xml @@ -15,7 +15,7 @@ - +
@@ -28,7 +28,6 @@ -
@@ -53,7 +52,6 @@ -
@@ -66,7 +64,7 @@
- + diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml index 2a1a3885c2e..e894a9d6ae5 100644 --- a/addons/crm/crm_phonecall_view.xml +++ b/addons/crm/crm_phonecall_view.xml @@ -15,7 +15,7 @@ - +
@@ -28,7 +28,6 @@ -
@@ -54,7 +53,7 @@ - +
@@ -66,7 +65,7 @@
- + From b5b678f2892832c1f236ae77ed3bdb6d3b188900 Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Mon, 18 Jan 2010 18:19:58 +0530 Subject: [PATCH 03/13] [IMP]:added filter buttons with group_by in project task search view and added field type to its tree view bzr revid: nch@tinyerp.com-20100118124958-qrxhq9m2vs8i8k39 --- addons/project/project_view.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index c7cfee65d20..a619d169859 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -372,6 +372,7 @@ + @@ -478,6 +479,9 @@ + + + From 8f83656717dbf12197276fd8ce76701351e41746 Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Mon, 18 Jan 2010 18:24:12 +0530 Subject: [PATCH 04/13] [IMP]: *Added allowed task types field in project. *Removed 'All Attachments' wizard. *Added 'Next' and 'Previous' buttons on task for task type field. *Changed demo data for task type. bzr revid: uco@tinyerp.co.in-20100118125412-sbd1ujtwcir0qqxj --- addons/project/project.py | 48 ++++++++++++++++++----- addons/project/project_demo.xml | 32 +++++++++------- addons/project/project_view.xml | 19 +++++++-- addons/project/project_wizard.xml | 1 - addons/project/wizard/__init__.py | 1 - addons/project/wizard/task_attachment.py | 49 ------------------------ addons/project_gtd/project_gtd_demo.xml | 4 +- 7 files changed, 74 insertions(+), 80 deletions(-) delete mode 100644 addons/project/wizard/task_attachment.py diff --git a/addons/project/project.py b/addons/project/project.py index 8bd78c1c80f..f58ac88e284 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -28,6 +28,21 @@ from tools.translate import _ from osv import fields, osv from tools.translate import _ +class project_task_type(osv.osv): + _name = 'project.task.type' + _description = 'Project task type' + _columns = { + 'name': fields.char('Type', required=True, size=64, translate=True), + 'description': fields.text('Description'), + 'sequence': fields.integer('Sequence'), + } + _order = 'sequence' + + _defaults = { + 'sequence': lambda *args: 1 + } +project_task_type() + class project(osv.osv): _name = "project.project" _description = "Project" @@ -119,6 +134,7 @@ class project(osv.osv): help='The project can be in either if the states \'Template\' and \'Running\'.\n If it is template then we can make projects based on the template projects. If its in \'Running\' state it is a normal project.\ \n If it is to be reviewed then the state is \'Pending\'.\n When the project is completed the state is set to \'Done\'.'), 'company_id': fields.many2one('res.company', 'Company'), + 'allowed_task_type': fields.many2many('project.task.type', 'project_task_type_rel', 'project_id', 'type_id', 'Allowed Task Types'), } _defaults = { @@ -206,15 +222,6 @@ class project(osv.osv): return True project() -class project_task_type(osv.osv): - _name = 'project.task.type' - _description = 'Project task type' - _columns = { - 'name': fields.char('Type', required=True, size=64, translate=True), - 'description': fields.text('Description'), - } -project_task_type() - class task(osv.osv): _name = "project.task" _description = "Tasks" @@ -431,6 +438,29 @@ class task(osv.osv): self.write(cr, uid, ids, {'state': 'pending'}) return True + def next_type(self, cr, uid, ids, *args): + type_obj = self.pool.get('project.task.type') + type_ids = type_obj.search(cr,uid,[]) + for typ in self.browse(cr, uid, ids): + typeid = typ.type.id + if typeid and type_ids.index(typeid) != len(type_ids)-1 : + index = type_ids.index(typeid) + else: + index = -1 + self.write(cr, uid, typ.id, {'type': type_ids[index+1]}) + return True + + def prev_type(self, cr, uid, ids, *args): + type_obj = self.pool.get('project.task.type') + type_ids = type_obj.search(cr,uid,[]) + for typ in self.browse(cr, uid, ids): + typeid = typ.type.id + if typeid and type_ids.index(typeid) != 0 : + index = type_ids.index(typeid) + else: + index = len(type_ids) + self.write(cr, uid, typ.id, {'type': type_ids[index - 1]}) + return True task() diff --git a/addons/project/project_demo.xml b/addons/project/project_demo.xml index e762d3874ba..a6970365c90 100644 --- a/addons/project/project_demo.xml +++ b/addons/project/project_demo.xml @@ -9,17 +9,21 @@
- - Analysis + + 1 + Specification - - New Feature + + 2 + Development - - Quotation + + 3 + Testing - - Bug + + 4 + Merge @@ -53,7 +57,7 @@ 38.0 38.0 - + BoM, After sales returns, interventions. Tracability. @@ -62,7 +66,7 @@ 16.0 16.0 - + Data importation + Doc @@ -70,7 +74,7 @@ 16.0 16.0 - + Modifications asked by the customer. @@ -78,7 +82,7 @@ 16.0 16.0 - + 0 @@ -88,7 +92,7 @@ 15 8.0 8.0 - + Internal testing + Software Install @@ -98,7 +102,7 @@ 17 16.0 16.0 - + 2 open diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index c7cfee65d20..18989fbf6d0 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -84,7 +84,7 @@ - + @@ -99,6 +99,8 @@ + + @@ -351,7 +353,10 @@ - + +