bzr revid: hmo@tinyerp.com-20100119070748-35odwc7zsfy03njd
This commit is contained in:
Harry (Open ERP) 2010-01-19 12:37:48 +05:30
commit 758cd9b751
39 changed files with 521 additions and 925 deletions

View File

@ -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):

View File

@ -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()

View File

@ -5,53 +5,63 @@
<!--
Claims Categories
-->
<record model="crm.claim.categ" id="categ_claim1">
<record model="crm.case.categ" id="categ_claim1">
<field name="name">Factual Claims</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.claim')]" model="ir.model"/>
</record>
<record model="crm.claim.categ" id="categ_claim2">
<record model="crm.case.categ" id="categ_claim2">
<field name="name">Value Claims</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.claim')]" model="ir.model"/>
</record>
<record model="crm.claim.categ" id="categ_claim3">
<record model="crm.case.categ" id="categ_claim3">
<field name="name">Policy Claims</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.claim')]" model="ir.model"/>
</record>
<!--
Case Category2
-->
<record model="crm.claim.type" id="type_claim1">
<record model="crm.case.resource.type" id="type_claim1">
<field name="name">Corrective</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.claim')]" model="ir.model"/>
</record>
<record model="crm.claim.type" id="type_claim2">
<record model="crm.case.resource.type" id="type_claim2">
<field name="name">Preventive</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.claim')]" model="ir.model"/>
</record>
<!--
Case Stage
-->
<record model="crm.claim.stage" id="stage_claim1">
<record model="crm.case.stage" id="stage_claim1">
<field name="name">Accepted as Claim</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.claim')]" model="ir.model"/>
</record>
<record model="crm.claim.stage" id="stage_claim2">
<record model="crm.case.stage" id="stage_claim2">
<field name="name">Fixed</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.claim')]" model="ir.model"/>
</record>
<record model="crm.claim.stage" id="stage_claim3">
<record model="crm.case.stage" id="stage_claim3">
<field name="name">Won't fix</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.claim')]" model="ir.model"/>
</record>
<record model="crm.claim.stage" id="stage_claim4">
<record model="crm.case.stage" id="stage_claim4">
<field name="name">Invalid</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.claim')]" model="ir.model"/>
</record>
<record model="crm.claim.stage" id="stage_claim5">
<record model="crm.case.stage" id="stage_claim5">
<field name="name">Awaiting Response</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.claim')]" model="ir.model"/>
</record>
</data>
</openerp>

View File

@ -4,73 +4,25 @@
# ------------------------------------------------------
# Claims
# ------------------------------------------------------
<!-- Claim Categories -->
<record id="crm_claim_categ_view_form" model="ir.ui.view">
<field name="name">crm.claim.categ.form</field>
<field name="model">crm.claim.categ</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Claim Category">
<field name="name" select="1"/>
<field name="probability"/>
<field name="section_id"/>
</form>
</field>
</record>
<record id="crm_claim_categ_view_tree" model="ir.ui.view">
<field name="name">crm.claim.categ.tree</field>
<field name="model">crm.claim.categ</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Claim Category">
<field name="name"/>
<field name="probability"/>
<field name="section_id"/>
</tree>
</field>
</record>
<record id="crm_claim_categ_action" model="ir.actions.act_window">
<field name="name">Claim Categories</field>
<field name="res_model">crm.claim.categ</field>
<field name="res_model">crm.case.categ</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_claim_categ_view_tree"/>
<field name="view_id" ref="crm.crm_case_categ_tree-view"/>
<field name="domain">[('object_id.model', '=', 'crm.claim')]</field>
<field name="context">{'object_id':'crm.claim'}</field>
</record>
<menuitem action="crm_claim_categ_action" id="menu_crm_case_claim-act" parent="crm.menu_crm_case_categ"/>
# ------------------------------------------------------
# Stage
# ------------------------------------------------------
<record model="ir.ui.view" id="crm_claim_stage_tree">
<field name="name">crm.claim.stage.tree</field>
<field name="model">crm.claim.stage</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Stages">
<field name="sequence"/>
<field name="name"/>
<field name="section_id"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="crm_claim_stage_form">
<field name="name">crm.claim.stage.form</field>
<field name="model">crm.claim.stage</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Stage">
<field name="name" select="1"/>
<field name="section_id" select="1" widget="selection"/>
<field name="sequence"/>
</form>
</field>
</record>
# ------------------------------------------------------
# Stages
# ------------------------------------------------------
<record id="crm_claim_stage_act" model="ir.actions.act_window">
<field name="name">Claim Stages</field>
<field name="res_model">crm.claim.stage</field>
<field name="res_model">crm.case.stage</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_claim_stage_tree"/>
<field name="view_id" ref="crm.crm_case_stage_tree"/>
<field name="domain">[('object_id.model', '=', 'crm.claim')]</field>
<field name="context">{'object_id':'crm.claim'}</field>
</record>
<menuitem action="crm_claim_stage_act" id="menu_crm_claim_stage_act" parent="crm.menu_crm_case_stage"/>

View File

@ -4,46 +4,54 @@
<!-- FUNDRAISING CATEGORY(categ_id) -->
<record model="crm.fundraising.categ" id="categ_fund1">
<record model="crm.case.categ" id="categ_fund1">
<field name="name">Social Rehabilitation And Rural Upliftment</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.fundraising')]" model="ir.model"/>
</record>
<record model="crm.fundraising.categ" id="categ_fund2">
<record model="crm.case.categ" id="categ_fund2">
<field name="name">Learning And Education</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.fundraising')]" model="ir.model"/>
</record>
<record model="crm.fundraising.categ" id="categ_fund3">
<record model="crm.case.categ" id="categ_fund3">
<field name="name">Healthcare</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.fundraising')]" model="ir.model"/>
</record>
<record model="crm.fundraising.categ" id="categ_fund4">
<record model="crm.case.categ" id="categ_fund4">
<field name="name">Arts And Culture</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.fundraising')]" model="ir.model"/>
</record>
<!-- CASE CATEGORY2(category2_id) -->
<!-- CASE Resource(type_id) -->
<record model="crm.fundraising.type" id="type_fund1">
<record model="crm.case.resource.type" id="type_fund1">
<field name="name">Cash</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.fundraising')]" model="ir.model"/>
</record>
<record model="crm.fundraising.type" id="type_fund2">
<record model="crm.case.resource.type" id="type_fund2">
<field name="name">Cheque</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.fundraising')]" model="ir.model"/>
</record>
<record model="crm.fundraising.type" id="type_fund3">
<record model="crm.case.resource.type" id="type_fund3">
<field name="name">Credit Card</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.fundraising')]" model="ir.model"/>
</record>
<record model="crm.fundraising.type" id="type_fund4">
<record model="crm.case.resource.type" id="type_fund4">
<field name="name">Demand Draft</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.fundraising')]" model="ir.model"/>
</record>
</data>

View File

@ -5,70 +5,25 @@
# ------------------------------------------------------
# Fund Raising Categories
# ------------------------------------------------------
<record id="crm_fund_categ_view_form" model="ir.ui.view">
<field name="name">crm.fundraising.categ.form</field>
<field name="model">crm.fundraising.categ</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Fundraising Category">
<field name="name" select="1"/>
<field name="probability"/>
<field name="section_id"/>
</form>
</field>
</record>
<record id="crm_fund_categ_view_tree" model="ir.ui.view">
<field name="name">crm.fundraising.categ.tree</field>
<field name="model">crm.fundraising.categ</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Fundraising Category">
<field name="name"/>
<field name="probability"/>
<field name="section_id"/>
</tree>
</field>
</record>
<record id="crm_fund_categ_action" model="ir.actions.act_window">
<field name="name">Fundraising Categories</field>
<field name="res_model">crm.fundraising.categ</field>
<field name="res_model">crm.case.categ</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_fund_categ_view_tree"/>
<field name="view_id" ref="crm.crm_case_categ_tree-view"/>
<field name="domain">[('object_id.model', '=', 'crm.fundraising')]</field>
<field name="context">{'object_id':'crm.fundraising'}</field>
</record>
<menuitem action="crm_fund_categ_action" id="menu_crm_case_fundraising-act" parent="crm.menu_crm_case_categ"/>
# ------------------------------------------------------
# Fund Stage
# ------------------------------------------------------
<record model="ir.ui.view" id="crm_fundraising_stage_tree">
<field name="name">crm.fundraising.stage.tree</field>
<field name="model">crm.fundraising.stage</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Stages">
<field name="sequence"/>
<field name="name"/>
<field name="section_id"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="crm_fundraising_stage_form">
<field name="name">crm.fundraising.stage.form</field>
<field name="model">crm.fundraising.stage</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Stage">
<field name="name" select="1"/>
<field name="section_id" select="1" widget="selection"/>
<field name="sequence"/>
</form>
</field>
</record>
<record id="crm_fundraising_stage_act" model="ir.actions.act_window">
<field name="name">Fundraising Stages</field>
<field name="res_model">crm.claim.stage</field>
<field name="res_model">crm.case.stage</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_fundraising_stage_tree"/>
<field name="view_id" ref="crm.crm_case_stage_tree"/>
<field name="domain">[('object_id.model', '=', 'crm.fundraising')]</field>
<field name="context">{'object_id':'crm.fundraising'}</field>
</record>
<menuitem action="crm_fundraising_stage_act" id="menu_crm_fundraising_stage_act" parent="crm.menu_crm_case_stage"/>

View File

@ -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}}

View File

@ -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()

View File

@ -5,36 +5,13 @@
# ------------------------------------------------------
# Helpdesk Support Categories
# ------------------------------------------------------
<record id="crm_helpdesk_categ_view_form" model="ir.ui.view">
<field name="name">crm.helpdesk.categ.form</field>
<field name="model">crm.helpdesk.categ</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Helpdesk Category">
<field name="name" select="1"/>
<field name="probability"/>
<field name="section_id"/>
</form>
</field>
</record>
<record id="crm_helpdesk_categ_view_tree" model="ir.ui.view">
<field name="name">crm.helpdesk.categ.tree</field>
<field name="model">crm.helpdesk.categ</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Helpdesk Category">
<field name="name"/>
<field name="probability"/>
<field name="section_id"/>
</tree>
</field>
</record>
<record id="crm_helpdesk_categ_action" model="ir.actions.act_window">
<field name="name">Helpdesk Categories</field>
<field name="res_model">crm.helpdesk.categ</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_helpdesk_categ_view_tree"/>
<field name="view_id" ref="crm.crm_case_categ_tree-view"/>
<field name="domain">[('object_id.model', '=', 'crm.helpdesk')]</field>
<field name="context">{'object_id':'crm.helpdesk'}</field>
</record>
<menuitem action="crm_helpdesk_categ_action" id="menu_crm_case_helpdesk-act" parent="crm.menu_crm_case_categ"/>
# ------------------------------------------------------

View File

@ -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()

View File

@ -2,93 +2,114 @@
<openerp>
<data noupdate="1">
<record model="crm.lead.categ" id="categ_lead1">
<record model="crm.case.categ" id="categ_lead1">
<field name="name">Existing Customer</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.lead.categ" id="categ_lead2">
<record model="crm.case.categ" id="categ_lead2">
<field name="name">Self Generated</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.lead.categ" id="categ_lead3">
<record model="crm.case.categ" id="categ_lead3">
<field name="name">Employee</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.lead.categ" id="categ_lead4">
<record model="crm.case.categ" id="categ_lead4">
<field name="name">Partner</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.lead.categ" id="categ_lead6">
<record model="crm.case.categ" id="categ_lead6">
<field name="name">Website</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.lead.categ" id="categ_lead7">
<record model="crm.case.categ" id="categ_lead7">
<field name="name">Word of mouth</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.lead.categ" id="categ_lead8">
<record model="crm.case.categ" id="categ_lead8">
<field name="name">Other</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<!-- CASE STATUS(stage_id) -->
<record model="crm.lead.stage" id="stage_lead1">
<record model="crm.case.stage" id="stage_lead1">
<field name="name">New</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.lead.stage" id="stage_lead2">
<record model="crm.case.stage" id="stage_lead2">
<field name="name">Assigned</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.lead.stage" id="stage_lead3">
<record model="crm.case.stage" id="stage_lead3">
<field name="name">In Process</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.lead.stage" id="stage_lead4">
<record model="crm.case.stage" id="stage_lead4">
<field name="name">Converted</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.lead.stage" id="stage_lead5">
<record model="crm.case.stage" id="stage_lead5">
<field name="name">Recycled</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.lead.stage" id="stage_lead6">
<record model="crm.case.stage" id="stage_lead6">
<field name="name">Dead</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<!-- CASE CATEGORY2(category2_id) -->
<record model="crm.lead.type" id="type_lead1">
<record model="crm.case.resource.type" id="type_lead1">
<field name="name">Telesales</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.lead.type" id="type_lead2">
<record model="crm.case.resource.type" id="type_lead2">
<field name="name">Mail</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.lead.type" id="type_lead3">
<record model="crm.case.resource.type" id="type_lead3">
<field name="name">Email</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.lead.type" id="type_lead4">
<record model="crm.case.resource.type" id="type_lead4">
<field name="name">Print</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.lead.type" id="type_lead5">
<record model="crm.case.resource.type" id="type_lead5">
<field name="name">Web</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.lead.type" id="type_lead6">
<record model="crm.case.resource.type" id="type_lead6">
<field name="name">Radio</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.lead.type" id="type_lead7">
<record model="crm.case.resource.type" id="type_lead7">
<field name="name">Television</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.lead.type" id="type_lead8">
<record model="crm.case.resource.type" id="type_lead8">
<field name="name">Newsletter</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
</data>

View File

@ -5,72 +5,27 @@
# ------------------------------------------------------
# Leads Categories
# ------------------------------------------------------
<record id="crm_lead_categ_view_form" model="ir.ui.view">
<field name="name">crm.lead.categ.form</field>
<field name="model">crm.lead.categ</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Lead Category">
<field name="name" select="1"/>
<field name="probability"/>
<field name="section_id"/>
</form>
</field>
</record>
<record id="crm_lead_categ_view_tree" model="ir.ui.view">
<field name="name">crm.lead.categ.tree</field>
<field name="model">crm.lead.categ</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Lead Category">
<field name="name"/>
<field name="probability"/>
<field name="section_id"/>
</tree>
</field>
</record>
<record id="crm_lead_categ_action" model="ir.actions.act_window">
<field name="name">Lead Categories</field>
<field name="res_model">crm.lead.categ</field>
<field name="res_model">crm.case.categ</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_lead_categ_view_tree"/>
<field name="view_id" ref="crm.crm_case_categ_tree-view"/>
<field name="domain">[('object_id.model', '=', 'crm.lead')]</field>
<field name="context">{'object_id':'crm.lead'}</field>
</record>
<menuitem action="crm_lead_categ_action" id="menu_crm_case_lead-act" parent="crm.menu_crm_case_categ"/>
# ------------------------------------------------------
# Stage
# ------------------------------------------------------
<record model="ir.ui.view" id="crm_lead_stage_tree">
<field name="name">crm.lead.stage.tree</field>
<field name="model">crm.lead.stage</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Stages">
<field name="sequence"/>
<field name="name"/>
<field name="section_id"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="crm_lead_stage_form">
<field name="name">crm.lead.stage.form</field>
<field name="model">crm.lead.stage</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Stage">
<field name="name" select="1"/>
<field name="section_id" select="1" widget="selection"/>
<field name="sequence"/>
</form>
</field>
</record>
<record id="crm_lead_stage_act" model="ir.actions.act_window">
<field name="name">Lead Stages</field>
<field name="res_model">crm.claim.stage</field>
<field name="res_model">crm.case.stage</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_lead_stage_tree"/>
<field name="view_id" ref="crm.crm_case_stage_tree"/>
<field name="domain">[('object_id.model', '=', 'crm.lead')]</field>
<field name="context">{'object_id':'crm.lead'}</field>
</record>
<menuitem action="crm_lead_stage_act" id="menu_crm_lead_stage_act" parent="crm.menu_crm_case_stage"/>
# ------------------------------------------------------

View File

@ -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):

View File

@ -4,22 +4,26 @@
<!-- CASE CATEGORY(categ_id) -->
<record model="crm.meeting.categ" id="categ_meet1">
<record model="crm.case.categ" id="categ_meet1">
<field name="name">Customer Meeting</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.fundraising')]" model="ir.model"/>
</record>
<record model="crm.meeting.categ" id="categ_meet2">
<record model="crm.case.categ" id="categ_meet2">
<field name="name">Internal Meeting</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.fundraising')]" model="ir.model"/>
</record>
<record model="crm.meeting.categ" id="categ_meet3">
<record model="crm.case.categ" id="categ_meet3">
<field name="name">Phone Call</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.meeting')]" model="ir.model"/>
</record>
<record model="res.request.link" id="request_link_meeting">
<field name="name">Case Meeting</field>
<field name="object">crm.meeting</field>
</record>
</data>

View File

@ -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()

View File

@ -1,77 +1,94 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="1">
<record model="crm.opportunity.categ" id="categ_oppor1">
<record model="crm.case.categ" id="categ_oppor1">
<field name="name">Existing Customer</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.opportunity')]" model="ir.model"/>
</record>
<record model="crm.opportunity.categ" id="categ_oppor2">
<record model="crm.case.categ" id="categ_oppor2">
<field name="name">Self Generated</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.opportunity')]" model="ir.model"/>
</record>
<record model="crm.opportunity.categ" id="categ_oppor3">
<record model="crm.case.categ" id="categ_oppor3">
<field name="name">Employee</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.opportunity')]" model="ir.model"/>
</record>
<record model="crm.opportunity.categ" id="categ_oppor4">
<record model="crm.case.categ" id="categ_oppor4">
<field name="name">Partner</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.opportunity')]" model="ir.model"/>
</record>
<record model="crm.opportunity.categ" id="categ_oppor5">
<record model="crm.case.categ" id="categ_oppor5">
<field name="name">Campaign</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.opportunity')]" model="ir.model"/>
</record>
<record model="crm.opportunity.categ" id="categ_oppor6">
<record model="crm.case.categ" id="categ_oppor6">
<field name="name">Website</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.opportunity')]" model="ir.model"/>
</record>
<record model="crm.opportunity.categ" id="categ_oppor7">
<record model="crm.case.categ" id="categ_oppor7">
<field name="name">Word of mouth</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.opportunity')]" model="ir.model"/>
</record>
<record model="crm.opportunity.categ" id="categ_oppor8">
<record model="crm.case.categ" id="categ_oppor8">
<field name="name">Other</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.opportunity')]" model="ir.model"/>
</record>
<!-- CASE STATUS(stage_id) -->
<record model="crm.opportunity.stage" id="stage_oppor1">
<record model="crm.case.stage" id="stage_oppor1">
<field name="name">Prospecting</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.opportunity')]" model="ir.model"/>
</record>
<record model="crm.opportunity.stage" id="stage_oppor2">
<record model="crm.case.stage" id="stage_oppor2">
<field name="name">Needs Analysis</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.opportunity')]" model="ir.model"/>
</record>
<record model="crm.opportunity.stage" id="stage_oppor3">
<record model="crm.case.stage" id="stage_oppor3">
<field name="name">Value Proposition</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.opportunity')]" model="ir.model"/>
</record>
<record model="crm.opportunity.stage" id="stage_oppor4">
<record model="crm.case.stage" id="stage_oppor4">
<field name="name">Proposal/Price Quote</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.opportunity')]" model="ir.model"/>
</record>
<record model="crm.opportunity.stage" id="stage_oppor5">
<record model="crm.case.stage" id="stage_oppor5">
<field name="name">Negotiation/Review</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.opportunity')]" model="ir.model"/>
</record>
<record model="crm.opportunity.stage" id="stage_oppor6">
<record model="crm.case.stage" id="stage_oppor6">
<field name="name">Closed Won</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.opportunity')]" model="ir.model"/>
</record>
<record model="crm.opportunity.stage" id="stage_oppor7">
<record model="crm.case.stage" id="stage_oppor7">
<field name="name">Closed Lost</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.opportunity')]" model="ir.model"/>
</record>
<!-- CASE CATEGORY2(category2_id) -->
<record model="crm.opportunity.type" id="type_oppor1">
<!-- Case Resource(type_id) -->
<record model="crm.case.resource.type" id="type_oppor1">
<field name="name">Existing Business</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.opportunity')]" model="ir.model"/>
</record>
<record model="crm.opportunity.type" id="type_oppor2">
<record model="crm.case.resource.type" id="type_oppor2">
<field name="name">New Business</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.opportunity')]" model="ir.model"/>
</record>
</data>

View File

@ -5,73 +5,26 @@
# ------------------------------------------------------
# Opportunity Categories
# ------------------------------------------------------
<record id="crm_opportunity_categ_view_form" model="ir.ui.view">
<field name="name">crm.opportunity.categ.form</field>
<field name="model">crm.opportunity.categ</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Opportunity Category">
<field name="name" select="1"/>
<field name="probability"/>
<field name="section_id"/>
</form>
</field>
</record>
<record id="crm_opportunity_categ_view_tree" model="ir.ui.view">
<field name="name">crm.opportunity.categ.tree</field>
<field name="model">crm.opportunity.categ</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Opportunity Category">
<field name="name"/>
<field name="probability"/>
<field name="section_id"/>
</tree>
</field>
</record>
<record id="crm_opportunity_categ_action" model="ir.actions.act_window">
<field name="name">Opportunity Categories</field>
<field name="res_model">crm.opportunity.categ</field>
<field name="res_model">crm.case.categ</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_opportunity_categ_view_tree"/>
<field name="view_id" ref="crm.crm_case_categ_tree-view"/>
<field name="domain">[('object_id.model', '=', 'crm.opportunity')]</field>
<field name="context">{'object_id':'crm.opportunity'}</field>
</record>
<menuitem action="crm_opportunity_categ_action" id="menu_crm_case_opportunity-act" parent="crm.menu_crm_case_categ"/>
# ------------------------------------------------------
# Stage
# ------------------------------------------------------
<record model="ir.ui.view" id="crm_opportunity_stage_tree">
<field name="name">crm.opportunity.stage.tree</field>
<field name="model">crm.opportunity.stage</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Stages">
<field name="sequence"/>
<field name="name"/>
<field name="section_id"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="crm_opportunity_stage_form">
<field name="name">crm.opportunity.stage.form</field>
<field name="model">crm.opportunity.stage</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Stage">
<field name="name" select="1"/>
<field name="section_id" select="1" widget="selection"/>
<field name="sequence"/>
</form>
</field>
</record>
<record id="crm_opportunity_stage_act" model="ir.actions.act_window">
<field name="name">Opportunity Stages</field>
<field name="res_model">crm.claim.stage</field>
<field name="res_model">crm.case.stage</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_opportunity_stage_tree"/>
<field name="view_id" ref="crm.crm_case_stage_tree"/>
<field name="domain">[('object_id.model', '=', 'crm.opportunity')]</field>
<field name="context">{'object_id':'crm.opportunity'}</field>
</record>
<menuitem action="crm_opportunity_stage_act" id="menu_crm_opportunity_stage_act" parent="crm.menu_crm_case_stage"/>
# ------------------------------------------------------

View File

@ -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()

View File

@ -6,29 +6,35 @@
<!--
Phonecall Categories
-->
<record model="crm.phonecall.categ" id="categ_phone1">
<record model="crm.case.categ" id="categ_phone1">
<field name="name">Inbound</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.phonecall')]" model="ir.model"/>
</record>
<record model="crm.phonecall.categ" id="categ_phone2">
<record model="crm.case.categ" id="categ_phone2">
<field name="name">Outbound</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.phonecall')]" model="ir.model"/>
</record>
<!--
Case Stage
-->
<record model="crm.phonecall.stage" id="stage_phone1">
<record model="crm.case.stage" id="stage_phone1">
<field name="name">Planned</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.phonecall')]" model="ir.model"/>
</record>
<record model="crm.phonecall.stage" id="stage_phone2">
<record model="crm.case.stage" id="stage_phone2">
<field name="name">Held</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.phonecall')]" model="ir.model"/>
</record>
<record model="crm.phonecall.stage" id="stage_phone3">
<record model="crm.case.stage" id="stage_phone3">
<field name="name">Not Held</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.phonecall')]" model="ir.model"/>
</record>
</data>
</openerp>

View File

@ -5,72 +5,27 @@
# ------------------------------------------------------
# Phonecall Categories
# ------------------------------------------------------
<record id="crm_phonecall_categ_view_form" model="ir.ui.view">
<field name="name">crm.phonecall.categ.form</field>
<field name="model">crm.phonecall.categ</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Phonecall Category">
<field name="name" select="1"/>
<field name="probability"/>
<field name="section_id"/>
</form>
</field>
</record>
<record id="crm_phonecall_categ_view_tree" model="ir.ui.view">
<field name="name">crm.phonecall.categ.tree</field>
<field name="model">crm.phonecall.categ</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Phonecall Category">
<field name="name"/>
<field name="probability"/>
<field name="section_id"/>
</tree>
</field>
</record>
<record id="crm_phonecall_categ_action" model="ir.actions.act_window">
<field name="name">Phonecall Categories</field>
<field name="res_model">crm.phonecall.categ</field>
<field name="res_model">crm.case.categ</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_phonecall_categ_view_tree"/>
<field name="view_id" ref="crm.crm_case_categ_tree-view"/>
<field name="domain">[('object_id.model', '=', 'crm.phonecall')]</field>
<field name="context">{'object_id':'crm.phonecall'}</field>
</record>
<menuitem action="crm_phonecall_categ_action" id="menu_crm_case_phonecall-act" parent="crm.menu_crm_case_categ"/>
# ------------------------------------------------------
# Fund Stage
# ------------------------------------------------------
<record model="ir.ui.view" id="crm_phonecall_stage_tree">
<field name="name">crm.phonecall.stage.tree</field>
<field name="model">crm.phonecall.stage</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Stages">
<field name="sequence"/>
<field name="name"/>
<field name="section_id"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="crm_phonecall_stage_form">
<field name="name">crm.phonecall.stage.form</field>
<field name="model">crm.phonecall.stage</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Stage">
<field name="name" select="1"/>
<field name="section_id" select="1" widget="selection"/>
<field name="sequence"/>
</form>
</field>
</record>
<record id="crm_phonecall_stage_act" model="ir.actions.act_window">
<field name="name">Phonecall Stages</field>
<field name="res_model">crm.phonecall.stage</field>
<field name="res_model">crm.case.stage</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_phonecall_stage_tree"/>
<field name="view_id" ref="crm.crm_case_stage_tree"/>
<field name="domain">[('object_id.model', '=', 'crm.phonecall')]</field>
<field name="context">{'object_id':'crm.phonecall'}</field>
</record>
<menuitem action="crm_phonecall_stage_act" id="menu_crm_phonecall_stage_act" parent="crm.menu_crm_case_stage"/>

View File

@ -47,8 +47,76 @@
<field name="view_type">form</field>
<field name="view_id" ref="crm_case_section_view_tree"/>
</record>
<menuitem id="menu_crm_case_stage" name="Stages" parent="crm.menu_crm_configuration"/>
<menuitem id="menu_crm_case_categ" name="Categories" parent="crm.menu_crm_configuration"/>
# ------------------------------------------------------
# Stage
# ------------------------------------------------------
<record model="ir.ui.view" id="crm_case_stage_tree">
<field name="name">crm.case.stage.tree</field>
<field name="model">crm.case.stage</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Stages">
<field name="sequence"/>
<field name="name"/>
<field name="section_id"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="crm_case_stage_form">
<field name="name">crm.case.stage.form</field>
<field name="model">crm.case.stage</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Stage">
<field name="name" select="1"/>
<field name="section_id" select="1" widget="selection"/>
<field name="object_id" invisible="1" />
<field name="sequence"/>
</form>
</field>
</record>
<record id="crm_case_stage_act" model="ir.actions.act_window">
<field name="name">Stages</field>
<field name="res_model">crm.case.stage</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_case_stage_tree"/>
</record>
<menuitem action="crm_case_stage_act" id="menu_crm_case_stage" name="Stages" parent="crm.menu_crm_configuration"/>
<!-- Case Categories -->
<record id="crm_case_categ-view" model="ir.ui.view">
<field name="name">crm.case.categ.form</field>
<field name="model">crm.case.categ</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Case Category">
<field name="name" select="1"/>
<field name="section_id" select="1" widget="selection"/>
<field name="object_id" invisible="1" />
<field name="probability"/>
</form>
</field>
</record>
<record id="crm_case_categ_tree-view" model="ir.ui.view">
<field name="name">crm.case.categ.tree</field>
<field name="model">crm.case.categ</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Case Category">
<field name="name"/>
<field name="section_id"/>
<field name="probability"/>
</tree>
</field>
</record>
<record id="crm_case_categ-act" model="ir.actions.act_window">
<field name="name">Categories</field>
<field name="res_model">crm.case.categ</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_case_categ_tree-view"/>
</record>
<menuitem id="menu_crm_case_categ" action="crm_case_categ-act" name="Categories" parent="crm.menu_crm_configuration"/>
<menuitem action="crm_case_section_act" id="menu_crm_case_section_act" parent="crm.menu_crm_configuration"/>

View File

@ -41,20 +41,20 @@ class opportunity2phonecall(wizard.interface):
<field name='note' colspan="4"/>
<newline />
<field name='section_id' />
<field name='category_id' domain="[('section_id','=',section_id)]"/>
<field name='category_id' domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.phonecall')]"/>
</form>"""
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')

View File

@ -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()

View File

@ -5,60 +5,72 @@
<!-- CASE CATEGORY(categ_id) -->
<record model="crm.job.categ" id="categ_job1">
<record model="crm.case.categ" id="categ_job1">
<field name="name">Salesman</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
</record>
<record model="crm.job.categ" id="categ_job2">
<record model="crm.case.categ" id="categ_job2">
<field name="name">Junior Developer</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
</record>
<!-- CATEGORY2(category2_id) -->
<!-- Resource(type_id) -->
<record model="crm.job.type" id="type_job1">
<record model="crm.case.resource.type" id="type_job1">
<field name="name">Graduate</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
</record>
<record model="crm.job.type" id="type_job2">
<record model="crm.case.resource.type" id="type_job2">
<field name="name">Licenced</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
</record>
<record model="crm.job.type" id="type_job3">
<record model="crm.case.resource.type" id="type_job3">
<field name="name"> > Bac +5</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
</record>
<!-- STAGE(stage_id) -->
<record model="crm.job.stage" id="stage_job1">
<record model="crm.case.stage" id="stage_job1">
<field name="name">Initial Jobs Demand</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
</record>
<record model="crm.job.stage" id="stage_job2">
<record model="crm.case.stage" id="stage_job2">
<field name="name">First Interview</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
</record>
<record model="crm.job.stage" id="stage_job3">
<record model="crm.case.stage" id="stage_job3">
<field name="name">Second Interview</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
</record>
<record model="crm.job.stage" id="stage_job4">
<record model="crm.case.stage" id="stage_job4">
<field name="name">Contract Proposed</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.claim')]" model="ir.model"/>
</record>
<record model="crm.job.stage" id="stage_job5">
<record model="crm.case.stage" id="stage_job5">
<field name="name">Contract Signed</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
</record>
<record model="crm.job.stage" id="stage_job6">
<record model="crm.case.stage" id="stage_job6">
<field name="name">Refused by Employee</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
</record>
<record model="crm.job.stage" id="stage_job7">
<record model="crm.case.stage" id="stage_job7">
<field name="name">Refused by Company</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
</record>
</data>
</openerp>

View File

@ -5,70 +5,25 @@
# ------------------------------------------------------
# Job Categories
# ------------------------------------------------------
<record id="crm_job_categ_view_form" model="ir.ui.view">
<field name="name">crm.job.categ.form</field>
<field name="model">crm.job.categ</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Job Category">
<field name="name" select="1"/>
<field name="probability"/>
<field name="section_id"/>
</form>
</field>
</record>
<record id="crm_job_categ_view_tree" model="ir.ui.view">
<field name="name">crm.job.categ.tree</field>
<field name="model">crm.job.categ</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Job Category">
<field name="name"/>
<field name="probability"/>
<field name="section_id"/>
</tree>
</field>
</record>
<record id="crm_job_categ_action" model="ir.actions.act_window">
<field name="name">Job Categories</field>
<field name="res_model">crm.job.categ</field>
<field name="res_model">crm.case.categ</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_job_categ_view_tree"/>
<field name="view_id" ref="crm.crm_case_categ_tree-view"/>
<field name="domain">[('object_id.model', '=', 'crm.claim')]</field>
<field name="context">{'object_id':'crm.job'}</field>
</record>
# ------------------------------------------------------
# Stage
# Stage
# ------------------------------------------------------
<record model="ir.ui.view" id="crm_job_stage_tree">
<field name="name">crm.job.stage.tree</field>
<field name="model">crm.job.stage</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Stages">
<field name="sequence"/>
<field name="name"/>
<field name="section_id"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="crm_job_stage_form">
<field name="name">crm.job.stage.form</field>
<field name="model">crm.job.stage</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Stage">
<field name="name" select="1"/>
<field name="section_id" select="1" widget="selection"/>
<field name="sequence"/>
</form>
</field>
</record>
<record id="crm_job_stage_act" model="ir.actions.act_window">
<field name="name">Job Stages</field>
<field name="res_model">crm.claim.stage</field>
<field name="res_model">crm.case.stage</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_job_stage_tree"/>
<field name="view_id" ref="crm.crm_case_stage_tree"/>
<field name="domain">[('object_id.model', '=', 'crm.claim')]</field>
<field name="context">{'object_id':'crm.job'}</field>
</record>
<menuitem action="crm_job_stage_act" id="menu_crm_job_stage_act" parent="crm.menu_crm_case_stage"/>
# ------------------------------------------------------

View File

@ -6,30 +6,35 @@
-->
<!-- For Bugs -->
<record model="crm.bug.categ" id="categ1">
<record model="crm.case.categ" id="categ1">
<field name="name">Bugs</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.project.bug')]" model="ir.model"/>
</record>
<record model="crm.bug.categ" id="categ2">
<record model="crm.case.categ" id="categ2">
<field name="name">Patches</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.project.bug')]" model="ir.model"/>
</record>
<record model="crm.bug.categ" id="categ3">
<record model="crm.case.categ" id="categ3">
<field name="name">Feature Requests</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.project.bug')]" model="ir.model"/>
</record>
<!--
Case Category2
Case type_id
-->
<!-- For Bugs -->
<record model="crm.bug.type" id="type1">
<record model="crm.case.resource.type" id="type1">
<field name="name">Version 4.2</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.project.bug')]" model="ir.model"/>
</record>
<record model="crm.bug.type" id="type2">
<record model="crm.case.resource.type" id="type2">
<field name="name">Version 4.4</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.project.bug')]" model="ir.model"/>
</record>
<!--
@ -37,33 +42,40 @@
-->
<!-- For Bugs -->
<record model="crm.bug.stage" id="stage1">
<record model="crm.case.stage" id="stage1">
<field name="name">Accepted as Bug</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.project.bug')]" model="ir.model"/>
</record>
<record model="crm.bug.stage" id="stage2">
<record model="crm.case.stage" id="stage2">
<field name="name">Fixed</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.project.bug')]" model="ir.model"/>
</record>
<record model="crm.bug.stage" id="stage3">
<record model="crm.case.stage" id="stage3">
<field name="name">Won't fix</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.project.bug')]" model="ir.model"/>
</record>
<record model="crm.bug.stage" id="stage4">
<record model="crm.case.stage" id="stage4">
<field name="name">Invalid</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.project.bug')]" model="ir.model"/>
</record>
<record model="crm.bug.stage" id="stage5">
<record model="crm.case.stage" id="stage5">
<field name="name">Awaiting Response</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.project.bug')]" model="ir.model"/>
</record>
<record model="crm.bug.stage" id="stage6">
<record model="crm.case.stage" id="stage6">
<field name="name">Works For Me</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.project.bug')]" model="ir.model"/>
</record>
<record model="crm.bug.stage" id="stage7">
<record model="crm.case.stage" id="stage7">
<field name="name">Future</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.project.bug')]" model="ir.model"/>
</record>
</data>

View File

@ -3,29 +3,35 @@
<data noupdate="1">
<record model="crm.bug.categ" id="categ1">
<record model="crm.case.categ" id="categ1">
<field name="name">Bugs</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.project.bug')]" model="ir.model"/>
</record>
<record model="crm.bug.categ" id="categ2">
<record model="crm.case.categ" id="categ2">
<field name="name">Patches</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.project.bug')]" model="ir.model"/>
</record>
<record model="crm.bug.categ" id="categ3">
<record model="crm.case.categ" id="categ3">
<field name="name">Feature Requests</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.project.bug')]" model="ir.model"/>
</record>
<record model="crm.bug.stage" id="stage2">
<record model="crm.case.stage" id="stage2">
<field name="name">Fixed</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.project.bug')]" model="ir.model"/>
</record>
<record model="crm.bug.stage" id="stage5">
<record model="crm.case.stage" id="stage5">
<field name="name">Awaiting Response</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.project.bug')]" model="ir.model"/>
</record>
<record model="crm.bug.stage" id="stage7">
<record model="crm.case.stage" id="stage7">
<field name="name">Future</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.project.bug')]" model="ir.model"/>
</record>

View File

@ -7,70 +7,25 @@
# Bug Categories
# ------------------------------------------------------
<record id="crm_bug_categ_view_form" model="ir.ui.view">
<field name="name">crm.bug.categ.form</field>
<field name="model">crm.bug.categ</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Bug Category">
<field name="name" select="1"/>
<field name="probability"/>
<field name="section_id"/>
</form>
</field>
</record>
<record id="crm_bug_categ_view_tree" model="ir.ui.view">
<field name="name">crm.bug.categ.tree</field>
<field name="model">crm.bug.categ</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Bug Category">
<field name="name"/>
<field name="probability"/>
<field name="section_id"/>
</tree>
</field>
</record>
<record id="crm_bug_categ_action" model="ir.actions.act_window">
<field name="name">Bug Categories</field>
<field name="res_model">crm.bug.categ</field>
<field name="res_model">crm.case.categ</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_bug_categ_view_tree"/>
<field name="view_id" ref="crm.crm_case_categ_tree-view"/>
<field name="domain">[('object_id.model', '=', 'crm.project.bug')]</field>
<field name="context">{'object_id':'crm.project.bug'}</field>
</record>
# ------------------------------------------------------
# Stage
# ------------------------------------------------------
<record model="ir.ui.view" id="crm_bug_stage_tree">
<field name="name">crm.bug.stage.tree</field>
<field name="model">crm.bug.stage</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Stages">
<field name="sequence"/>
<field name="name"/>
<field name="section_id"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="crm_bug_stage_form">
<field name="name">crm.bug.stage.form</field>
<field name="model">crm.bug.stage</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Stage">
<field name="name" select="1"/>
<field name="section_id" select="1" widget="selection"/>
<field name="sequence"/>
</form>
</field>
</record>
<record id="crm_bug_stage_act" model="ir.actions.act_window">
<field name="name">Bug Stages</field>
<field name="res_model">crm.bug.stage</field>
<field name="res_model">crm.case.stage</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_bug_stage_tree"/>
<field name="view_id" ref="crm.crm_case_stage_tree"/>
<field name="domain">[('object_id.model', '=', 'crm.project.bug')]</field>
<field name="context">{'object_id':'crm.project.bug'}</field>
</record>
<menuitem action="crm_bug_stage_act" id="menu_crm_bug_stage_act" parent="crm.menu_crm_case_stage"/>

View File

@ -3,17 +3,20 @@
<data noupdate="1">
<record model="crm.bug.categ" id="future_patch_categ">
<record model="crm.case.categ" id="future_patch_categ">
<field name="name">Patches</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.project.future')]" model="ir.model"/>
</record>
<record model="crm.bug.stage" id="future_fixed_categ">
<record model="crm.case.stage" id="future_fixed_categ">
<field name="name">Fixed</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.project.future')]" model="ir.model"/>
</record>
<record model="crm.bug.stage" id="future_awaiting_categ">
<record model="crm.case.stage" id="future_awaiting_categ">
<field name="name">Awaiting Response</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.project.future')]" model="ir.model"/>
</record>

View File

@ -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}}

View File

@ -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()

View File

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

View File

@ -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()

View File

@ -9,17 +9,21 @@
<field name="project_time_mode_id" ref="product.uom_hour"></field>
</record>
<record id="project_tt_analysis" model="project.task.type">
<field name="name">Analysis</field>
<record id="project_tt_specification" model="project.task.type">
<field name="sequence">1</field>
<field name="name">Specification</field>
</record>
<record id="project_tt_feature" model="project.task.type">
<field name="name">New Feature</field>
<record id="project_tt_development" model="project.task.type">
<field name="sequence">2</field>
<field name="name">Development</field>
</record>
<record id="project_tt_quote" model="project.task.type">
<field name="name">Quotation</field>
<record id="project_tt_testing" model="project.task.type">
<field name="sequence">3</field>
<field name="name">Testing</field>
</record>
<record id="project_tt_bug" model="project.task.type">
<field name="name">Bug</field>
<record id="project_tt_merge" model="project.task.type">
<field name="sequence">4</field>
<field name="name">Merge</field>
</record>
<record id="project_project_9" model="project.project">
@ -53,7 +57,7 @@
<record id="project_task_116" model="project.task">
<field name="planned_hours">38.0</field>
<field name="remaining_hours">38.0</field>
<field name="type" ref="project_tt_feature"/>
<field name="type" ref="project_tt_development"/>
<field name="user_id" ref="base.user_root"/>
<field name="project_id" ref="project_project_22"/>
<field name="description">BoM, After sales returns, interventions. Tracability.</field>
@ -62,7 +66,7 @@
<record id="project_task_130" model="project.task">
<field name="planned_hours">16.0</field>
<field name="remaining_hours">16.0</field>
<field name="type" ref="project_tt_feature"/>
<field name="type" ref="project_tt_development"/>
<field model="res.users" name="user_id" search="[('login','=','demo')]"/>
<field name="project_id" ref="project_project_23"/>
<field name="name">Data importation + Doc</field>
@ -70,7 +74,7 @@
<record id="project_task_131" model="project.task">
<field name="planned_hours">16.0</field>
<field name="remaining_hours">16.0</field>
<field name="type" ref="project_tt_feature"/>
<field name="type" ref="project_tt_development"/>
<field model="res.users" name="user_id" search="[('login','=','demo')]"/>
<field name="project_id" ref="project_project_23"/>
<field name="name">Modifications asked by the customer.</field>
@ -78,7 +82,7 @@
<record id="project_task_184" model="project.task">
<field name="planned_hours">16.0</field>
<field name="remaining_hours">16.0</field>
<field name="type" ref="project_tt_feature"/>
<field name="type" ref="project_tt_development"/>
<field model="res.users" name="user_id" search="[('login','=','demo')]"/>
<field name="priority">0</field>
<field name="project_id" ref="project_project_21"/>
@ -88,7 +92,7 @@
<field name="sequence">15</field>
<field name="planned_hours">8.0</field>
<field name="remaining_hours">8.0</field>
<field name="type" ref="project_tt_feature"/>
<field name="type" ref="project_tt_development"/>
<field model="res.users" name="user_id" search="[('login','=','demo')]"/>
<field name="project_id" ref="project_project_21"/>
<field name="name">Internal testing + Software Install</field>
@ -98,7 +102,7 @@
<field name="sequence">17</field>
<field name="planned_hours">16.0</field>
<field name="remaining_hours">16.0</field>
<field name="type" ref="project_tt_feature"/>
<field name="type" ref="project_tt_development"/>
<field model="res.users" name="user_id" search="[('login','=','demo')]"/>
<field name="priority">2</field>
<field name="state">open</field>

View File

@ -84,7 +84,7 @@
</group>
</page>
<page string="Tasks">
<field name="tasks" nolabel="1" attrs="{'readonly':[('state','in',['cancelled','done'])]}">
<field name="tasks" nolabel="1" attrs="{'readonly':[('state','in',['cancelled','done'])]}" colspan="4">
<tree colors="grey:state in ('cancelled','done');blue:remaining_hours&lt;0;red:bool(date_deadline) and (date_deadline&lt;current_date) and (state in ('draft','open'));black:state not in ('cancelled','done')" string="Tasks">
<!-- <tree string="Tasks">-->
<field name="sequence"/>
@ -99,6 +99,8 @@
<field name="remaining_hours" invisible="1"/>
</tree>
</field>
<separator string="Allowed Task Types"/>
<field nolabel="1" name="allowed_task_type" colspan="4" groups="base.group_extended"/>
</page>
<page string="Notes">
<field colspan="4" name="notes" nolabel="1"/>
@ -350,10 +352,14 @@
<field name="date_close" select="2"/>
</group>
<separator string="Miscelleanous" colspan="4"/>
<field name="type" widget="selection"/>
<field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
<field name="active" select="2"/>
<field name="partner_id" select="2"/>
<field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
<group col="4" colspan="2">
<field name="type" widget="selection" />
<button name="prev_type" string="Previous" type="object" icon="gtk-go-back" help="Change to Previous Type"/>
<button name="next_type" string="Next" type="object" icon="gtk-go-forward" help="Change to Next Type"/>
</group>
<field name="active" select="2"/>
<separator colspan="4" string="Notes"/>
<field colspan="4" name="notes" nolabel="1"/>
</page>
@ -371,9 +377,12 @@
<field name="sequence" string="Seq."/>
<field name="name"/>
<field name="project_id" icon="gtk-indent"/>
<field name="type"/>
<field name="user_id"/>
<field name="date_deadline"/>
<field name="remaining_hours" widget="float_time"/>
<field name="type"/>
<button name="next_type" states="draft,open,pending" string="Change Type" type="object" icon="gtk-go-forward" help="Change Type"/>
<field name="progress" widget="progressbar"/>
<field name="state"/>
<button name="do_open" states="pending,draft" string="Start Task" type="object" icon="gtk-execute" help="For changing to open state"/>
@ -476,9 +485,10 @@
<group col="8" colspan="4">
<filter string="Draft" domain="[('state','=','draft')]" help="Draft Tasks" icon="terp-project"/>
<filter string="In Progress" domain="[('state','=','open')]" help="Open Tasks" icon="terp-project"/>
<filter string="Pending" domain="[('state','=','pending')]" help="Pending Tasks" icon="terp-project"/>
<filter string="Pending" domain="[('state','=','pending')]" help="Pending Tasks" icon="terp-project"/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="type" select="1" widget="selection"/>
<field name="project_id" select="1" widget="selection">
<filter domain="[('manager_id','=',False)]" help="Unassigned Project" icon="terp-project"/>
</field>
@ -500,6 +510,7 @@
<field name="view_mode">tree,form,calendar,gantt,graph</field>
<field eval="False" name="view_id"/>
<field eval="True" name="filter"/>
<field name="view_id" ref="view_task_tree2"/>
<field name="search_view_id" ref="view_task_search_form"/>
</record>
<!--<menuitem action="action_view_task" id="menu_action_view_task" parent="project.menu_tasks"/> -->
@ -539,7 +550,8 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Task type">
<field colspan="4" name="name" select="1"/>
<field name="name" select="1"/>
<field name="sequence"/>
<field colspan="4" name="description" select="1"/>
</form>
</field>
@ -550,6 +562,7 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Task type">
<field name="sequence"/>
<field name="name"/>
</tree>
</field>

View File

@ -3,6 +3,5 @@
<data>
<wizard id="wizard_close_task" menu="False" model="project.task" name="project.task.close" string="Close Task"/>
<wizard id="wizard_delegate_task" menu="False" model="project.task" name="project.task.delegate" string="Delegate Task"/>
<!-- <wizard id="wizard_attachment_task" model="project.task" name="project.task.attachment" string="All Attachments"/> -->
</data>
</openerp>

View File

@ -21,7 +21,6 @@
import close_task
import task_delegate
import task_attachment
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,49 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import wizard
import pooler
'''View the attachments of the parent + children tasks'''
def _show_attachment(self, cr, uid, data, context):
task_obj = pooler.get_pool(cr.dbname).get('project.task')
task_browse_id = task_obj.browse(cr, uid, [data['id']], context)[0]
attachment_list = [child_id.id for child_id in task_browse_id.child_ids]
attachment_list.extend([task_browse_id.parent_id.id])
value = {
'domain': [('res_model','=',data['model']),('res_id','in',attachment_list)],
'name': 'Attachments',
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'ir.attachment',
'context': { },
'type': 'ir.actions.act_window'
}
return value
class wizard_attachment(wizard.interface):
states = {
'init': {
'actions': [],
'result': {'type':'action', 'action':_show_attachment, 'state': 'end'},
},
}
wizard_attachment('project.task.attachment')

View File

@ -45,7 +45,7 @@
<field name="remaining_hours">38.0</field>
<field name="timebox_id" ref="timebox_daily"/>
<field name="context_id" ref="context_office"/>
<field name="type" ref="project.project_tt_feature"/>
<field name="type" ref="project.project_tt_development"/>
<field name="user_id" ref="base.user_root"/>
<field name="project_id" ref="project.project_project_22"/>
<field name="name">Specific adaptation to MRP</field>
@ -78,7 +78,7 @@
<field name="remaining_hours">38.0</field>
<field name="timebox_id" ref="timebox_daily"/>
<field name="context_id" ref="context_office"/>
<field name="type" ref="project.project_tt_feature"/>
<field name="type" ref="project.project_tt_development"/>
<field name="user_id" ref="base.user_root"/>
<field name="project_id" ref="project.project_project_22"/>
<field name="name">Specific adaptation to MRP</field>