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')