Improve historyze of cases

bzr revid: ced-18275b4f33a55553164edd0c9bcb9dd627adec4c
This commit is contained in:
ced 2007-09-13 14:21:42 +00:00
parent 021604879e
commit 9e278cd519
3 changed files with 57 additions and 42 deletions

View File

@ -244,12 +244,12 @@ class crm_case(osv.osv):
_name = "crm.case"
_description = "Case"
_columns = {
'id': fields.integer('Case ID', readonly=True),
'name': fields.char('Case Description',size=64, required=True),
'id': fields.integer('ID', readonly=True),
'name': fields.char('Description',size=64, required=True),
'priority': fields.selection(AVAILABLE_PRIORITIES, 'Priority'),
'active': fields.boolean('Active'),
'description': fields.text('Your action'),
'section_id': fields.many2one('crm.case.section', 'Case Section', required=True, select=True),
'section_id': fields.many2one('crm.case.section', 'Section', required=True, select=True),
'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id)]"),
'planned_revenue': fields.float('Planned Revenue'),
'planned_cost': fields.float('Planned Costs'),
@ -261,9 +261,9 @@ class crm_case(osv.osv):
'partner_address_id': fields.many2one('res.partner.address', 'Partner Contact', domain="[('partner_id','=',partner_id)]"),
'som': fields.many2one('res.partner.som', 'State of Mind'),
'date': fields.datetime('Date'),
'create_date': fields.datetime('Date Created'),
'date_deadline': fields.date('Date Deadline'),
'date_closed': fields.datetime('Date Closed', readonly=True),
'create_date': fields.datetime('Created' ,readonly=True),
'date_deadline': fields.date('Deadline'),
'date_closed': fields.datetime('Closed', readonly=True),
'canal_id': fields.many2one('res.partner.canal', 'Channel'),
'user_id': fields.many2one('res.users', 'User Responsible'),
'history_line': fields.one2many('crm.case.history', 'case_id', 'Communication'),
@ -272,8 +272,8 @@ class crm_case(osv.osv):
'ref' : fields.reference('Reference', selection=_links_get, size=128),
'ref2' : fields.reference('Reference 2', selection=_links_get, size=128),
'date_action_last': fields.datetime('Date Last Action', readonly=1),
'date_action_next': fields.datetime('Date Next Action', readonly=1),
'date_action_last': fields.datetime('Last Action', readonly=1),
'date_action_next': fields.datetime('Next Action', readonly=1),
}
_defaults = {
'active': lambda *a: 1,
@ -281,6 +281,7 @@ class crm_case(osv.osv):
'state': lambda *a: 'draft',
'priority': lambda *a: AVAILABLE_PRIORITIES[2][0],
'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
'create_date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
}
_order = 'priority, date_deadline desc, id desc'
@ -434,7 +435,7 @@ class crm_case(osv.osv):
'case_id': case.id
}
obj = self.pool.get('crm.case.log')
if history:
if history and case.description:
obj = self.pool.get('crm.case.history')
data['description'] = case.description
data['email'] = email or \
@ -612,7 +613,7 @@ class crm_case_log(osv.osv):
_description = "Case communication history"
_order = "id desc"
_columns = {
'name': fields.char('Name', size=64),
'name': fields.char('Action', size=64),
'som': fields.many2one('res.partner.som', 'State of Mind'),
'date': fields.datetime('Date'),
'canal_id': fields.many2one('res.partner.canal', 'Channel'),

View File

@ -1,6 +1,11 @@
<?xml version="1.0"?>
<terp>
<data>
<report string="Business Opportunities" model="crm.case" name="crm.case" auto="False"/>
<report
string="Business Opportunities"
model="crm.case"
name="crm.case"
auto="False"
menu="False"/>
</data>
</terp>

View File

@ -266,24 +266,24 @@
<field name="arch" type="xml">
<form string="Cases">
<notebook>
<page string="General Information">
<field name="name" select="1"/>
<field name="section_id"/>
<page string="General">
<group col="8" colspan="4">
<field name="name" select="1" colspan="4"/>
<field name="section_id" colspan="3"/>
<field name="date" select="1"/>
<field name="priority"/>
<field name="partner_id" select="1" on_change="onchange_partner_id(partner_id, email_from)"/>
<field name="partner_address_id" select="2" on_change="onchange_partner_address_id(partner_address_id, email_from)"/>
<field name="date_deadline" select="2"/>
<field name="priority" colspan="3"/>
<field name="partner_id" select="1" on_change="onchange_partner_id(partner_id, email_from)" colspan="4"/>
<field name="partner_address_id" select="2" on_change="onchange_partner_address_id(partner_address_id, email_from)" colspan="3"/>
<newline/>
<field name="email_from" select="2" colspan="3"/>
<button name="remind_partner" string="Send Reminder" states="open,pending" type="object"/>
<field name="user_id" select="1"/>
<group col="2" colspan="2">
<button name="remind_user" string="Send Reminder" states="open,pending" type="object"/>
</group>
<field name="email_from" select="2"/>
<group col="2" colspan="2">
<button name="remind_partner" string="Send Reminder" states="open,pending" type="object"/>
<button name="remind_user" string="Send Reminder" states="open,pending" type="object"/>
</group>
<field name="history_line" colspan="4" nolabel="1" mode="form,tree">
<form string="Communication">
<field name="history_line" colspan="4" nolabel="1" mode="tree,form">
<form string="Communication history">
<group col="6" colspan="4">
<field name="date" select="1"/>
<field name="email" select="1"/>
@ -292,16 +292,24 @@
<newline/>
<field name="description" colspan="4" nolabel="1" select="2"/>
</form>
<tree string="Communication history">
<field name="email"/>
<field name="date"/>
<field name="description"/>
</tree>
</field>
<separator colspan="4"/>
<field name="canal_id"/>
<field name="som" select="2"/>
<field name="description" colspan="4" select="2" nolabel="1"/>
<field name="date_deadline" select="2"/>
<label colspan="2"/>
<group col="2" colspan="2">
<button name="case_log_reply" string="Send" states="open" type="object"/>
<button name="case_log_reply" string="Send Partner &amp; Historize" states="open" type="object"/>
<button name="case_log" string="Historize" states="open" type="object"/>
</group>
<field name="state" select="1"/>
<group col="6" colspan="2">
<button name="case_close" string="Close" states="open,draft,pending" type="object"/>
<button name="case_open" string="Open" states="draft,pending" type="object"/>
@ -310,25 +318,26 @@
<button name="case_escalate" string="Escalate" states="open,draft,pending" type="object"/>
<button name="case_reset" string="Reset to Draft" states="done,cancel" type="object"/>
</group>
</page><page string="References">
</page>
<page string="Extra Info">
<field name="id" select="1"/>
<field name="categ_id" select="2" on_change="onchange_categ_id(categ_id)"/>
<field name="date_closed"/>
<field name="active" select="2"/>
<field name="ref" colspan="4"/>
<field name="ref2" colspan="4"/>
<field name="som" select="2"/>
<field name="canal_id"/>
<field name="email_cc" colspan="4"/>
<field name="categ_id" select="2" on_change="onchange_categ_id(categ_id)"/>
<separator colspan="4" string="Dates"/>
<field name="create_date"/>
<field name="date_closed"/>
<field name="date_action_last"/>
<field name="date_action_next"/>
<separator colspan="4" string="Estimates"/>
<field name="planned_revenue"/>
<field name="planned_cost"/>
<field name="probability"/>
<newline/>
<field name="date_action_last"/>
<field name="date_action_next"/>
<field name="email_cc" colspan="4"/>
<field name="email_last" colspan="4"/>
</page><page string="History">
<separator colspan="4" string="References"/>
<field name="ref" colspan="4"/>
<field name="ref2" colspan="4"/>
</page>
<page string="History">
<field name="log_ids" nolabel="1" colspan="4">
<form string="Actions">
<separator string="Action Information" colspan="4"/>