diff --git a/addons/crm/crm.py b/addons/crm/crm.py index 53173754b8e..854f67477e1 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -101,6 +101,67 @@ 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'), + } + def _find_object_id(self, cr, uid, context=None): + object_id = context and context.get('object_id', False) or False + ids =self.pool.get('ir.model').search(cr, uid, [('model', '=', object_id)]) + return ids and ids[0] + _defaults = { + 'probability': lambda *args: 0.0, + 'object_id' : _find_object_id + } +# +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'), + } + def _find_object_id(self, cr, uid, context=None): + object_id = context and context.get('object_id', False) or False + ids =self.pool.get('ir.model').search(cr, uid, [('model', '=', object_id)]) + return ids and ids[0] + _defaults = { + 'object_id' : _find_object_id + } +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'), + } + def _find_object_id(self, cr, uid, context=None): + object_id = context and context.get('object_id', False) or False + ids =self.pool.get('ir.model').search(cr, uid, [('model', '=', object_id)]) + return ids and ids[0] + _defaults = { + 'sequence': lambda *args: 1, + 'object_id' : _find_object_id + } + +crm_case_stage() class crm_case_rule(osv.osv): diff --git a/addons/crm/crm_claim.py b/addons/crm/crm_claim.py index 9b7ede2748f..781ce45bacb 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),('object_id.model', '=', 'crm.claim')]"), '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),('object_id.model', '=', 'crm.claim')]"), '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),('object_id.model', '=', 'crm.claim')]"), } _defaults = { @@ -98,7 +61,7 @@ class crm_claim(osv.osv): def onchange_categ_id(self, cr, uid, ids, categ, context={}): if not categ: return {'value':{}} - cat = self.pool.get('crm.claim.categ').browse(cr, uid, categ, context).probability + cat = self.pool.get('crm.case.categ').browse(cr, uid, categ, context).probability return {'value':{'probability':cat}} crm_claim() 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..0e81f4f34e2 100644 --- a/addons/crm/crm_claims_view.xml +++ b/addons/crm/crm_claims_view.xml @@ -4,73 +4,25 @@ # ------------------------------------------------------ # Claims # ------------------------------------------------------ - - - - - crm.claim.categ.form - crm.claim.categ - form - -
- - - - - -
- - crm.claim.categ.tree - crm.claim.categ - tree - - - - - - - - - Claim Categories - crm.claim.categ + crm.case.categ form - + + [('object_id.model', '=', 'crm.claim')] + {'object_id':'crm.claim'} - # ------------------------------------------------------ - # Stage - # ------------------------------------------------------ - - crm.claim.stage.tree - crm.claim.stage - tree - - - - - - - - - - crm.claim.stage.form - crm.claim.stage - form - -
- - - - - -
+ # ------------------------------------------------------ + # Stages + # ------------------------------------------------------ Claim Stages - crm.claim.stage + crm.case.stage form - + + [('object_id.model', '=', 'crm.claim')] + {'object_id':'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..4fec4afb976 100644 --- a/addons/crm/crm_fund_view.xml +++ b/addons/crm/crm_fund_view.xml @@ -5,70 +5,25 @@ # ------------------------------------------------------ # Fund Raising Categories # ------------------------------------------------------ - - crm.fundraising.categ.form - crm.fundraising.categ - form - -
- - - - - -
- - crm.fundraising.categ.tree - crm.fundraising.categ - tree - - - - - - - - - Fundraising Categories - crm.fundraising.categ + crm.case.categ form - + + [('object_id.model', '=', 'crm.fundraising')] + {'object_id':'crm.fundraising'} # ------------------------------------------------------ # Fund Stage # ------------------------------------------------------ - - crm.fundraising.stage.tree - crm.fundraising.stage - tree - - - - - - - - - - crm.fundraising.stage.form - crm.fundraising.stage - form - -
- - - - - -
Fundraising Stages - crm.claim.stage + crm.case.stage form - + + [('object_id.model', '=', 'crm.fundraising')] + {'object_id':'crm.fundraising'} diff --git a/addons/crm/crm_fundraising.py b/addons/crm/crm_fundraising.py index 367cebcaf8f..046065e61f2 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),('object_id.model', '=', 'crm.fundraising')]"), '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..ca4bf47006b 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,13 +54,13 @@ 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),('object_id.model', '=', 'crm.helpdesk')]"), 'duration': fields.float('Duration'), } def onchange_categ_id(self, cr, uid, ids, categ, context={}): if not categ: return {'value':{}} - cat = self.pool.get('crm.helpdesk.categ').browse(cr, uid, categ, context).probability + cat = self.pool.get('crm.case.categ').browse(cr, uid, categ, context).probability return {'value':{'probability':cat}} crm_helpdesk() diff --git a/addons/crm/crm_helpdesk_view.xml b/addons/crm/crm_helpdesk_view.xml index 25c2d68b787..c8fb0bc3c07 100644 --- a/addons/crm/crm_helpdesk_view.xml +++ b/addons/crm/crm_helpdesk_view.xml @@ -5,36 +5,13 @@ # ------------------------------------------------------ # Helpdesk Support Categories # ------------------------------------------------------ - - crm.helpdesk.categ.form - crm.helpdesk.categ - form - -
- - - - - -
- - crm.helpdesk.categ.tree - crm.helpdesk.categ - tree - - - - - - - - - Helpdesk Categories crm.helpdesk.categ form - + + [('object_id.model', '=', 'crm.helpdesk')] + {'object_id':'crm.helpdesk'} # ------------------------------------------------------ diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 9fe1b1c4236..8fd0f81f6a4 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -34,45 +34,10 @@ 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" + _description = "Opportunity Cases" crm_opportunity() class crm_lead(osv.osv): @@ -81,8 +46,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),('object_id.model', '=', 'crm.lead')]"), + 'type_id': fields.many2one('crm.case.resource.type', 'Lead Type Name', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.lead')]"), '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 +61,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),('object_id.model', '=', 'crm.lead')]"), '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)."), @@ -106,7 +71,7 @@ class crm_lead(osv.osv): def onchange_categ_id(self, cr, uid, ids, categ, context={}): if not categ: return {'value':{}} - cat = self.pool.get('crm.lead.categ').browse(cr, uid, categ, context).probability + cat = self.pool.get('crm.case.categ').browse(cr, uid, categ, context).probability return {'value':{'probability':cat}} crm_lead() 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..e541440150c 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -5,72 +5,27 @@ # ------------------------------------------------------ # Leads Categories # ------------------------------------------------------ - - - crm.lead.categ.form - crm.lead.categ - form - -
- - - - - -
- - crm.lead.categ.tree - crm.lead.categ - tree - - - - - - - - Lead Categories - crm.lead.categ + crm.case.categ form - + + [('object_id.model', '=', 'crm.lead')] + {'object_id':'crm.lead'} # ------------------------------------------------------ # Stage # ------------------------------------------------------ - - crm.lead.stage.tree - crm.lead.stage - tree - - - - - - - - - - crm.lead.stage.form - crm.lead.stage - form - -
- - - - - -
Lead Stages - crm.claim.stage + crm.case.stage form - + + [('object_id.model', '=', 'crm.lead')] + {'object_id':'crm.lead'} # ------------------------------------------------------ diff --git a/addons/crm/crm_meeting.py b/addons/crm/crm_meeting.py index d73823bd710..c1f4cbf995a 100644 --- a/addons/crm/crm_meeting.py +++ b/addons/crm/crm_meeting.py @@ -27,19 +27,6 @@ from tools.translate import _ import base64 import re -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' @@ -66,7 +53,7 @@ class crm_meeting(osv.osv): 'url': {'field': 'caldav_url', 'type': 'text'}, 'recurrence-id': {'field': 'recurrent_id', 'type': 'datetime'}, 'attendee': {'field': 'attendee_ids', 'type': 'many2many', 'object': 'calendar.attendee'}, - 'categories': {'field': 'categ_id', 'type': 'many2one', 'object': 'crm.meeting.categ'}, + 'categories': {'field': 'categ_id', 'type': 'many2one', 'object': 'crm.case.categ'}, 'comment': None, 'contact': None, 'exdate': {'field': 'exdate', 'type': 'datetime'}, @@ -124,8 +111,8 @@ 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', \ - domain="[('section_id','=',section_id)]", \ + 'categ_id': fields.many2one('crm.case.categ', 'Category', \ + domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.meeting')]", \ help='Category related to the section.Subdivide the CRM cases \ independently or section-wise.'), 'description': fields.text('Your action'), @@ -399,24 +386,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..35a85cad6ee 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),('object_id.model', '=', 'crm.opportunity')]"), + 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]"), + 'type_id': fields.many2one('crm.case.resource.type', 'Resource Type', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]"), 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'), 'probability': fields.float('Probability (%)'), 'planned_revenue': fields.float('Planned Revenue'), @@ -98,7 +61,7 @@ class crm_opportunity(osv.osv): def onchange_categ_id(self, cr, uid, ids, categ, context={}): if not categ: return {'value':{}} - cat = self.pool.get('crm.opportunity.categ').browse(cr, uid, categ, context).probability + cat = self.pool.get('crm.case.categ').browse(cr, uid, categ, context).probability return {'value':{'probability':cat}} crm_opportunity() 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..05572e8ef89 100644 --- a/addons/crm/crm_opportunity_view.xml +++ b/addons/crm/crm_opportunity_view.xml @@ -5,73 +5,26 @@ # ------------------------------------------------------ # Opportunity Categories # ------------------------------------------------------ - - - crm.opportunity.categ.form - crm.opportunity.categ - form - -
- - - - - -
- - crm.opportunity.categ.tree - crm.opportunity.categ - tree - - - - - - - - Opportunity Categories - crm.opportunity.categ + crm.case.categ form - + + [('object_id.model', '=', 'crm.opportunity')] + {'object_id':'crm.opportunity'} # ------------------------------------------------------ # Stage # ------------------------------------------------------ - - crm.opportunity.stage.tree - crm.opportunity.stage - tree - - - - - - - - - - - crm.opportunity.stage.form - crm.opportunity.stage - form - -
- - - - - -
- Opportunity Stages - crm.claim.stage + crm.case.stage form - + + [('object_id.model', '=', 'crm.opportunity')] + {'object_id':'crm.opportunity'} # ------------------------------------------------------ diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py index b9a2d198144..1a0c4c1b78d 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),('object_id.model', '=', 'crm.phonecall')]"), '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" \ @@ -84,7 +57,7 @@ class crm_phonecall(osv.osv): def onchange_categ_id(self, cr, uid, ids, categ, context={}): if not categ: return {'value':{}} - cat = self.pool.get('crm.phonecall.categ').browse(cr, uid, categ, context).probability + 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..5d9208a887b 100644 --- a/addons/crm/crm_phonecall_view.xml +++ b/addons/crm/crm_phonecall_view.xml @@ -5,72 +5,27 @@ # ------------------------------------------------------ # Phonecall Categories # ------------------------------------------------------ - - - crm.phonecall.categ.form - crm.phonecall.categ - form - -
- - - - - -
- - crm.phonecall.categ.tree - crm.phonecall.categ - tree - - - - - - - - - + Phonecall Categories - crm.phonecall.categ + crm.case.categ form - + + [('object_id.model', '=', 'crm.phonecall')] + {'object_id':'crm.phonecall'} # ------------------------------------------------------ # Fund Stage # ------------------------------------------------------ - - crm.phonecall.stage.tree - crm.phonecall.stage - tree - - - - - - - - - - crm.phonecall.stage.form - crm.phonecall.stage - form - -
- - - - - -
Phonecall Stages - crm.phonecall.stage + crm.case.stage form - + + [('object_id.model', '=', 'crm.phonecall')] + {'object_id':'crm.phonecall'} diff --git a/addons/crm/crm_view.xml b/addons/crm/crm_view.xml index b6d16c2fcbd..646fa758e9d 100644 --- a/addons/crm/crm_view.xml +++ b/addons/crm/crm_view.xml @@ -47,8 +47,76 @@ form
- - + + # ------------------------------------------------------ + # Stage + # ------------------------------------------------------ + + crm.case.stage.tree + crm.case.stage + tree + + + + + + + + + + crm.case.stage.form + crm.case.stage + form + +
+ + + + + + +
+ + Stages + crm.case.stage + form + + + + + + crm.case.categ.form + crm.case.categ + form + +
+ + + + + + +
+ + crm.case.categ.tree + crm.case.categ + tree + + + + + + + + + + + Categories + crm.case.categ + form + + + diff --git a/addons/crm/wizard/crm_opportunity_wizard.py b/addons/crm/wizard/crm_opportunity_wizard.py index 49ae48f62fa..9641c6ac055 100644 --- a/addons/crm/wizard/crm_opportunity_wizard.py +++ b/addons/crm/wizard/crm_opportunity_wizard.py @@ -41,20 +41,20 @@ class opportunity2phonecall(wizard.interface): - + """ case_fields = { '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') diff --git a/addons/crm_hr/crm_hr.py b/addons/crm_hr/crm_hr.py index e3aaadb45fe..da144da950a 100644 --- a/addons/crm_hr/crm_hr.py +++ b/addons/crm_hr/crm_hr.py @@ -34,43 +34,6 @@ from osv.orm import except_orm from crm import crm -class crm_job_categ(osv.osv): - _name = "crm.job.categ" - _description = "Job 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_job_categ() - -class crm_job_type(osv.osv): - _name = "crm.job.type" - _description = "Job 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_job_type() - -class crm_job_stage(osv.osv): - _name = "crm.job.stage" - _description = "Stage of job 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_job_stage() class crm_job(osv.osv): _name = "crm.job" @@ -80,7 +43,7 @@ class crm_job(osv.osv): _columns = { 'date_closed': fields.datetime('Closed', readonly=True), 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'), - 'categ_id': fields.many2one('crm.job.categ', 'Category', domain="[('section_id','=',section_id)]"), + 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.job')]"), 'planned_revenue': fields.float('Planned Revenue'), 'planned_cost': fields.float('Planned Costs'), 'probability': fields.float('Probability (%)'), @@ -88,8 +51,8 @@ class crm_job(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.job.stage', 'Stage', domain="[('section_id','=',section_id)]"), - 'type_id': fields.many2one('crm.job.type', 'Type Name', domain="[('section_id','=',section_id)]"), + 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.job')]"), + 'type_id': fields.many2one('crm.case.resource.type', 'Type Name', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.job')]"), 'duration': fields.float('Duration'), 'case_id': fields.many2one('crm.case', 'Related Case'), 'ref' : fields.reference('Reference', selection=crm._links_get, size=128), @@ -105,7 +68,7 @@ class crm_job(osv.osv): def onchange_categ_id(self, cr, uid, ids, categ, context={}): if not categ: return {'value':{}} - cat = self.pool.get('crm.categ.categ').browse(cr, uid, categ, context).probability + cat = self.pool.get('crm.case.categ').browse(cr, uid, categ, context).probability return {'value':{'probability':cat}} crm_job() diff --git a/addons/crm_hr/crm_hr_data.xml b/addons/crm_hr/crm_hr_data.xml index 2486981eded..94a47be6d2f 100644 --- a/addons/crm_hr/crm_hr_data.xml +++ b/addons/crm_hr/crm_hr_data.xml @@ -5,60 +5,72 @@ - + Salesman + - + Junior Developer + - + - + Graduate + - + Licenced + - + > Bac +5 + - + Initial Jobs Demand + - + First Interview + - + Second Interview + - + Contract Proposed + - + Contract Signed + - + Refused by Employee + - + Refused by Company +
diff --git a/addons/crm_hr/crm_hr_view.xml b/addons/crm_hr/crm_hr_view.xml index bb90d62b960..7e9d4249075 100644 --- a/addons/crm_hr/crm_hr_view.xml +++ b/addons/crm_hr/crm_hr_view.xml @@ -5,70 +5,25 @@ # ------------------------------------------------------ # Job Categories # ------------------------------------------------------ - - - crm.job.categ.form - crm.job.categ - form - -
- - - - - -
- - crm.job.categ.tree - crm.job.categ - tree - - - - - - - - Job Categories - crm.job.categ + crm.case.categ form - + + [('object_id.model', '=', 'crm.claim')] + {'object_id':'crm.job'} # ------------------------------------------------------ - # Stage + # Stage # ------------------------------------------------------ - - crm.job.stage.tree - crm.job.stage - tree - - - - - - - - - - crm.job.stage.form - crm.job.stage - form - -
- - - - - -
Job Stages - crm.claim.stage + crm.case.stage form - + + [('object_id.model', '=', 'crm.claim')] + {'object_id':'crm.job'} # ------------------------------------------------------ diff --git a/addons/crm_project/crm_bugs_data.xml b/addons/crm_project/crm_bugs_data.xml index b43d61adf8f..ca891949499 100644 --- a/addons/crm_project/crm_bugs_data.xml +++ b/addons/crm_project/crm_bugs_data.xml @@ -6,30 +6,35 @@ --> - + Bugs + - + Patches + - + Feature Requests + - + Version 4.2 + - + Version 4.4 + - + Accepted as Bug + - + Fixed + - + Won't fix + - + Invalid + - + Awaiting Response + - + Works For Me + - + Future + diff --git a/addons/crm_project/crm_bugs_menu.xml b/addons/crm_project/crm_bugs_menu.xml index 6fc73243ddb..627fab57aba 100644 --- a/addons/crm_project/crm_bugs_menu.xml +++ b/addons/crm_project/crm_bugs_menu.xml @@ -3,29 +3,35 @@ - + Bugs + - + Patches + - + Feature Requests + - + Fixed + - + Awaiting Response + - + Future + diff --git a/addons/crm_project/crm_bugs_view.xml b/addons/crm_project/crm_bugs_view.xml index cbda54e128b..04f596751f9 100644 --- a/addons/crm_project/crm_bugs_view.xml +++ b/addons/crm_project/crm_bugs_view.xml @@ -7,70 +7,25 @@ # Bug Categories # ------------------------------------------------------ - - - crm.bug.categ.form - crm.bug.categ - form - -
- - - - - -
- - crm.bug.categ.tree - crm.bug.categ - tree - - - - - - - - Bug Categories - crm.bug.categ + crm.case.categ form - + + [('object_id.model', '=', 'crm.project.bug')] + {'object_id':'crm.project.bug'} # ------------------------------------------------------ # Stage # ------------------------------------------------------ - - crm.bug.stage.tree - crm.bug.stage - tree - - - - - - - - - - crm.bug.stage.form - crm.bug.stage - form - -
- - - - - -
Bug Stages - crm.bug.stage + crm.case.stage form - + + [('object_id.model', '=', 'crm.project.bug')] + {'object_id':'crm.project.bug'} diff --git a/addons/crm_project/crm_feature_menu.xml b/addons/crm_project/crm_feature_menu.xml index 25b8b14f2f9..299c441e0cf 100644 --- a/addons/crm_project/crm_feature_menu.xml +++ b/addons/crm_project/crm_feature_menu.xml @@ -3,17 +3,20 @@ - + Patches + - + Fixed + - + Awaiting Response + diff --git a/addons/crm_project/crm_project_bug.py b/addons/crm_project/crm_project_bug.py index 98439ffba33..fa408b8a570 100644 --- a/addons/crm_project/crm_project_bug.py +++ b/addons/crm_project/crm_project_bug.py @@ -34,44 +34,6 @@ from osv.orm import except_orm from crm import crm -class crm_bug_categ(osv.osv): - _name = "crm.bug.categ" - _description = " Bug 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_bug_categ() - -class crm_bug_type(osv.osv): - _name = "crm.bug.type" - _description = "Bug 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_bug_type() - -class crm_bug_stage(osv.osv): - _name = "crm.bug.stage" - _description = "Stage of Project Bug" - _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_bug_stage() class crm_project_bug(osv.osv): _name = "crm.project.bug" @@ -89,14 +51,14 @@ class crm_project_bug(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.bug.categ','Category', domain="[('section_id','=',section_id)]"), + 'categ_id': fields.many2one('crm.case.categ','Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.project.bug')]"), 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'), - 'type_id': fields.many2one('crm.bug.type', 'Bug Type', domain="[('section_id','=',section_id)]"), + 'type_id': fields.many2one('crm.case.resource.type', 'Bug Type', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.project.bug')]"), '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.bug.stage', 'Stage', domain="[('section_id','=',section_id)]"), + 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.project.bug')]"), 'project_id':fields.many2one('project.project', 'Project'), 'duration': fields.float('Duration') , 'probability': fields.float('Probability (%)'), @@ -114,7 +76,7 @@ class crm_project_bug(osv.osv): def onchange_categ_id(self, cr, uid, ids, categ, context={}): if not categ: return {'value':{}} - cat = self.pool.get('crm.bug.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_project/crm_project_feature.py b/addons/crm_project/crm_project_feature.py index 6200b3b2d01..18674cda5db 100644 --- a/addons/crm_project/crm_project_feature.py +++ b/addons/crm_project/crm_project_feature.py @@ -50,14 +50,14 @@ class crm_project_future_request(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.bug.categ','Category', domain="[('section_id','=',section_id)]"), + 'categ_id': fields.many2one('crm.case.categ','Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.project.future')]"), 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'), - 'type_id': fields.many2one('crm.bug.type', 'Bug Type', domain="[('section_id','=',section_id)]"), + 'type_id': fields.many2one('crm.case.resource.type', 'Bug Type', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.project.future')]"), '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.bug.stage', 'Stage', domain="[('section_id','=',section_id)]"), + 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.project.future')]"), 'project_id':fields.many2one('project.project', 'Project'), 'duration': fields.float('Duration') , 'probability': fields.float('Probability (%)'), @@ -71,6 +71,12 @@ class crm_project_future_request(osv.osv): _defaults = { 'project_id':_get_project } + 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_project_future_request() diff --git a/addons/hr/hr.py b/addons/hr/hr.py index 40c428a9663..0d4d5f5bad0 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -134,8 +134,8 @@ class hr_employee(osv.osv): 'address_id': fields.many2one('res.partner.address', 'Working Address'), 'address_home_id': fields.many2one('res.partner.address', 'Home Address'), - 'work_phone': fields.char('Work Phone', size=32), - 'work_email': fields.char('Work Email', size=128), + 'work_phone': fields.related('address_id', 'phone', type='char', string='Work Phone'), + 'work_email': fields.related('address_id', 'email', type='char', string='Work E-mail'), 'work_location': fields.char('Office Location', size=32), 'notes': fields.text('Notes'), diff --git a/addons/project/project.py b/addons/project/project.py index e1681013a55..886a32e4890 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 5d081b6030d..50e8d58ba10 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -84,7 +84,7 @@ - + @@ -99,6 +99,8 @@ + + @@ -350,10 +352,14 @@ - - - + + + +