[MERGE] phone call improvement
bzr revid: tfr@openerp.com-20110420152059-g0nfynokt1oieaze
This commit is contained in:
@@ -53,7 +53,7 @@ class crm_phonecall(crm_case, osv.osv):
|
||||
('draft', 'Draft'),
|
||||
('open', 'Todo'),
|
||||
('cancel', 'Cancelled'),
|
||||
('done', 'Done'),
|
||||
('done', 'Held'),
|
||||
('pending', 'Pending'),
|
||||
], 'State', size=16, readonly=True,
|
||||
help='The state is set to \'Draft\', when a case is created.\
|
||||
@@ -79,14 +79,19 @@ class crm_phonecall(crm_case, osv.osv):
|
||||
the canall which is this opportunity source."),
|
||||
'date_closed': fields.datetime('Closed', readonly=True),
|
||||
'date': fields.datetime('Date'),
|
||||
'opportunity_id': fields.many2one ('crm.lead', 'Opportunity'),
|
||||
'opportunity_id': fields.many2one ('crm.lead', 'Lead/Opportunity'),
|
||||
'message_ids': fields.one2many('mailgate.message', 'res_id', 'Messages', domain=[('model','=',_name)]),
|
||||
}
|
||||
|
||||
def _get_default_state(self, cr, uid, context=None):
|
||||
if context and context.get('default_state', False):
|
||||
return context.get('default_state')
|
||||
return 'open'
|
||||
|
||||
_defaults = {
|
||||
'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
'priority': crm.AVAILABLE_PRIORITIES[2][0],
|
||||
'state': 'open',
|
||||
'state': _get_default_state,
|
||||
'user_id': lambda self,cr,uid,ctx: uid,
|
||||
'active': 1,
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
<field name="categ_id" ref="crm.categ_phone1"/>
|
||||
<field eval=""(769) 703-274"" name="partner_phone"/>
|
||||
<field eval="2.3" name="duration"/>
|
||||
<field eval=""done"" name="state"/>
|
||||
</record>
|
||||
<record id="crm_case_phone02" model="crm.phonecall">
|
||||
<field name="partner_address_id" ref="base.res_partner_address_6"/>
|
||||
@@ -33,6 +34,7 @@
|
||||
<field name="categ_id" ref="crm.categ_phone1"/>
|
||||
<field eval=""(956) 293-2595"" name="partner_phone"/>
|
||||
<field eval="1.5" name="duration"/>
|
||||
<field eval=""done"" name="state"/>
|
||||
</record>
|
||||
<record id="crm_case_phone03" model="crm.phonecall">
|
||||
<field name="partner_address_id" ref="base.res_partner_address_2"/>
|
||||
@@ -49,6 +51,7 @@
|
||||
<field eval=""(079) 681-2139"" name="partner_phone"/>
|
||||
<field eval=""contact@tecsas.fr"" name="email_from"/>
|
||||
<field eval="5.0" name="duration"/>
|
||||
<field eval=""done"" name="state"/>
|
||||
</record>
|
||||
<record id="crm_case_phone04" model="crm.phonecall">
|
||||
<field eval="time.strftime('%Y-%m-21 14:10:23')" name="date"/>
|
||||
|
||||
@@ -61,15 +61,15 @@
|
||||
parent="base.menu_base_partner" sequence="4" />
|
||||
|
||||
<record model="ir.actions.act_window" id="crm_case_categ_phone_incoming0">
|
||||
<field name="name">Inbound</field>
|
||||
<field name="name">Log a call</field>
|
||||
<field name="res_model">crm.phonecall</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,calendar</field>
|
||||
<field name="view_id" ref="crm_case_phone_tree_view"/>
|
||||
<field name="domain" eval="'[(\'categ_id\',\'=\','+str(ref('categ_phone1'))+')]'"/>
|
||||
<field name="context" eval="'{\'search_default_section_id\':section_id, \'default_state\':\'open\', \'search_default_current\':1,\'search_default_today\':1, \'default_categ_id\': ' + str(ref('categ_phone1')) +'}'"/>
|
||||
<field name="view_id" ref="crm_case_inbound_phone_tree_view"/>
|
||||
<field name="domain">[('state','=','done')]</field>
|
||||
<field name="context" eval="'{\'search_default_section_id\':section_id, \'default_state\':\'done\', \'search_default_today\':1}'"/>
|
||||
<field name="search_view_id" ref="crm.view_crm_case_phonecalls_filter"/>
|
||||
<field name="help">The Inbound Calls tool allows you to log your inbound calls on the fly. Each call you get will appear on the partner form to trace every contact you have with a partner. From the phone call form, you can trigger a request for another call, a meeting or an opportunity.</field>
|
||||
<field name="help">This tool allows you to log your inbound calls on the fly. Each call you get will appear on the partner form to trace every contact you have with a partner. From the phone call form, you can trigger a request for another call, a meeting or an opportunity.</field>
|
||||
|
||||
</record>
|
||||
|
||||
@@ -90,24 +90,24 @@
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_form_phone_incoming0">
|
||||
<field name="sequence" eval="3"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="crm_case_inbound_phone_form_view"/>
|
||||
<field name="view_id" ref="crm_case_phone_form_view"/>
|
||||
<field name="act_window_id" ref="crm_case_categ_phone_incoming0"/>
|
||||
</record>
|
||||
|
||||
<menuitem name="Inbound" id="menu_crm_case_phone_inbound"
|
||||
<menuitem name="Log a call" id="menu_crm_case_phone_inbound"
|
||||
parent="crm.menu_crm_case_phone"
|
||||
action="crm_case_categ_phone_incoming0" />
|
||||
|
||||
<record model="ir.actions.act_window" id="crm_case_categ_phone_outgoing0">
|
||||
<field name="name">Outbound</field>
|
||||
<field name="name">Schedule a call</field>
|
||||
<field name="res_model">crm.phonecall</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,calendar</field>
|
||||
<field name="view_id" ref="crm_case_phone_tree_view"/>
|
||||
<field name="domain" eval="'[(\'categ_id\',\'=\','+str(ref('categ_phone2'))+')]'"/>
|
||||
<field name="context" eval="'{\'search_default_section_id\':section_id, \'default_state\':\'open\', \'search_default_current\':1, \'default_categ_id\': ' + str(ref('categ_phone2')) +'}'"/>
|
||||
<field name="domain">[('state','!=','done')]</field>
|
||||
<field name="context" eval="'{\'search_default_section_id\':section_id, \'default_state\':\'open\', \'search_default_current\':1,\'search_default_today\':1}'"/>
|
||||
<field name="search_view_id" ref="crm.view_crm_case_phonecalls_filter"/>
|
||||
<field name="help">Outbound Calls list all the calls to be done by your sales team. A salesman can record the information about the call in the form view. This information will be stored in the partner form to trace every contact you have with a customer. You can also import a .CSV file with a list of calls to be done by your sales team.</field>
|
||||
<field name="help">Schedule a call lists all the calls to be done by your sales team. A salesman can record the information about the call in the form view. This information will be stored in the partner form to trace every contact you have with a customer. You can also import a .CSV file with a list of calls to be done by your sales team.</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window.view" id="action_crm_tag_tree_phone_outgoing0">
|
||||
@@ -131,7 +131,7 @@
|
||||
<field name="act_window_id" ref="crm_case_categ_phone_outgoing0"/>
|
||||
</record>
|
||||
|
||||
<menuitem name="Outbound" id="menu_crm_case_phone_outbound"
|
||||
<menuitem name="Schedule a call" id="menu_crm_case_phone_outbound"
|
||||
parent="crm.menu_crm_case_phone"
|
||||
action="crm_case_categ_phone_outgoing0" />
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<field name="partner_contact"/>
|
||||
<field name="partner_phone"/>
|
||||
<field name="user_id"/>
|
||||
<field name="categ_id" string="Type"/>
|
||||
<field name="categ_id"/>
|
||||
<field name="create_date" invisible="1"/>
|
||||
<button string="Convert to Opportunity"
|
||||
name="%(phonecall2opportunity_act)d"
|
||||
@@ -43,7 +43,7 @@
|
||||
name="action_make_meeting" type="object" />
|
||||
<field name="state"/>
|
||||
<button name="case_cancel" string="Cancel" states="draft,open,pending" type="object" icon="gtk-cancel"/>
|
||||
<button name="case_open" string="Open" states="draft,pending" type="object" icon="gtk-go-forward"/>
|
||||
<button name="case_open" string="Todo" states="draft,pending" type="object" icon="gtk-go-forward"/>
|
||||
<button name="case_close" string="Held" states="open,draft,pending" type="object" icon="gtk-jump-to"/>
|
||||
<button name="case_pending" string="Not Held" states="open" type="object" icon="gtk-media-pause"/>
|
||||
</tree>
|
||||
@@ -61,7 +61,7 @@
|
||||
<group colspan="6" col="7">
|
||||
<field name="name" required="1"/>
|
||||
<field name="partner_phone"/>
|
||||
<field name="duration" widget="float_time" required="1"/>
|
||||
<field name="duration" widget="float_time"/>
|
||||
<button string="Schedule a Meeting" name="action_make_meeting" icon="gtk-redo" type="object"/>
|
||||
|
||||
<field name="date" required="1"/>
|
||||
@@ -70,7 +70,7 @@
|
||||
<button string="Convert to Opportunity"
|
||||
name="%(phonecall2opportunity_act)d"
|
||||
icon="gtk-index" type="action"
|
||||
attrs="{'invisible':[('opportunity_id','!=',False)]}" />
|
||||
attrs="{'invisible':['|', ('opportunity_id','!=',False), ('state','=','done')]}" />
|
||||
<label colspan="6" string=""/>
|
||||
<button string="Schedule Other Call"
|
||||
icon="terp-call-start"
|
||||
@@ -98,8 +98,7 @@
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Categorization" />
|
||||
<field name="categ_id" widget="selection"
|
||||
domain="[('object_id.model', '=', 'crm.phonecall')]"
|
||||
string="Type" />
|
||||
domain="[('object_id.model', '=', 'crm.phonecall')]"/>
|
||||
<field name="priority"/>
|
||||
<field name="opportunity_id"/>
|
||||
</group>
|
||||
@@ -111,7 +110,7 @@
|
||||
<button name="case_cancel" string="Cancel"
|
||||
states="draft,open,pending" type="object"
|
||||
icon="gtk-cancel" />
|
||||
<button name="case_open" string="Open"
|
||||
<button name="case_open" string="Todo"
|
||||
states="draft,pending" type="object"
|
||||
icon="gtk-go-forward" />
|
||||
<button name="case_pending" string="Not Held"
|
||||
@@ -120,83 +119,21 @@
|
||||
states="open,draft,pending" type="object"
|
||||
icon="gtk-jump-to" />
|
||||
<button name="case_reset" string="Reset to Draft"
|
||||
states="done,cancel" type="object"
|
||||
states="cancel" type="object"
|
||||
icon="gtk-convert" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!--Inbound Phonecalls Form View -->
|
||||
|
||||
<record model="ir.ui.view" id="crm_case_inbound_phone_form_view">
|
||||
<field name="name">CRM - Inbound Phone Call Form</field>
|
||||
<field name="model">crm.phonecall</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Phone Call">
|
||||
<group colspan="4" col="7">
|
||||
<field name="name" required="1"/>
|
||||
<field name="partner_phone"/>
|
||||
<field name="duration" widget="float_time"/>
|
||||
<button string="Schedule a Meeting"
|
||||
name="action_make_meeting"
|
||||
icon="gtk-redo"
|
||||
type="object" />
|
||||
|
||||
<field name="date" required="1"/>
|
||||
<field name="user_id"/>
|
||||
<field name="section_id" colspan="1" widget="selection" />
|
||||
<button string="Convert to Opportunity"
|
||||
name="%(phonecall2opportunity_act)d"
|
||||
icon="gtk-index" type="action"
|
||||
attrs="{'invisible':[('opportunity_id','!=',False)]}" />
|
||||
<label colspan="6" string=""/>
|
||||
<button string="Schedule Other Call"
|
||||
icon="terp-call-start"
|
||||
name="%(phonecall_to_phonecall_act)d"
|
||||
type="action" />
|
||||
|
||||
</group>
|
||||
<group col="3" colspan="2">
|
||||
<separator colspan="3" string="Contacts" />
|
||||
<field name="partner_id"
|
||||
on_change="onchange_partner_id(partner_id, email_from)" />
|
||||
<button string="Create a Partner"
|
||||
icon="terp-partner"
|
||||
name="%(action_crm_phonecall2partner)d"
|
||||
type="action"
|
||||
attrs="{'invisible':[('partner_id','!=',False)]}"
|
||||
groups="base.group_partner_manager" />
|
||||
<newline/>
|
||||
<field name="partner_address_id"
|
||||
on_change="onchange_partner_address_id(partner_address_id, email_from)" />
|
||||
<newline/>
|
||||
<field name="partner_mobile" />
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Categorization" />
|
||||
<field name="categ_id" widget="selection"
|
||||
domain="[('object_id.model', '=', 'crm.phonecall')]"
|
||||
string="Type" />
|
||||
<field name="priority"/>
|
||||
<field name="opportunity_id"/>
|
||||
</group>
|
||||
<separator string="Description" colspan="4" />
|
||||
<field name="description" nolabel="1" colspan="4" />
|
||||
<separator colspan="4" />
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!--Inbound Phonecalls Tree View -->
|
||||
<!--Logged Phonecalls Tree View -->
|
||||
|
||||
<record model="ir.ui.view" id="crm_case_inbound_phone_tree_view">
|
||||
<field name="name">CRM - Inbound Phone Calls Tree</field>
|
||||
<field name="name">CRM - Logged Phone Calls Tree</field>
|
||||
<field name="model">crm.phonecall</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Phone Calls" colors="grey:state in ('cancel','done');blue:state in ('pending',)" editable="top">
|
||||
<tree string="Phone Calls" editable="top">
|
||||
<field name="date"/>
|
||||
<field name="name"/>
|
||||
<field name="partner_id"
|
||||
@@ -207,21 +144,15 @@
|
||||
<field name="partner_phone"/>
|
||||
<field name="user_id"/>
|
||||
<field name="categ_id" widget="selection"
|
||||
domain="[('object_id.model', '=', 'crm.phonecall')]"
|
||||
string="Type" />
|
||||
domain="[('object_id.model', '=', 'crm.phonecall')]"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="create_date" invisible="1"/>
|
||||
<button string="Schedule Other Call"
|
||||
icon="terp-call-start"
|
||||
name="%(phonecall_to_phonecall_act)d"
|
||||
type="action" />
|
||||
<button string="Convert to Opportunity"
|
||||
name="%(phonecall2opportunity_act)d"
|
||||
states="draft,open,pending"
|
||||
icon="gtk-index"
|
||||
type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}" />
|
||||
<button string="Meeting"
|
||||
states="draft,open,pending" icon="gtk-redo"
|
||||
icon="gtk-redo"
|
||||
name="action_make_meeting" type="object" />
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
@@ -25,9 +25,9 @@ from crm import crm
|
||||
|
||||
AVAILABLE_STATES = [
|
||||
('draft','Draft'),
|
||||
('open','Open'),
|
||||
('open','Todo'),
|
||||
('cancel', 'Cancelled'),
|
||||
('done', 'Closed'),
|
||||
('done', 'Held'),
|
||||
('pending','Pending')
|
||||
]
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
<filter string="Partner" icon="terp-partner" context="{'group_by':'partner_id'}" />
|
||||
<separator orientation="vertical" />
|
||||
<filter string="Priority" icon="terp-rating-rated" domain="[]" context="{'group_by':'priority'}" />
|
||||
<filter string="Type" icon="terp-stock_symbol-selection"
|
||||
<filter string="Category" icon="terp-stock_symbol-selection"
|
||||
domain="[]" context="{'group_by':'categ_id'}" />
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize"
|
||||
domain="[]" context="{'group_by':'state'}" />
|
||||
|
||||
@@ -54,82 +54,14 @@
|
||||
<tree string="Phone Calls" colors="gray:state in ('draft', 'cancel','done','pending')">
|
||||
<field name="date" string="Date"/>
|
||||
<field name="name" string="Call Summary"/>
|
||||
<field name="categ_id" string="Type" widget="selection"/>
|
||||
<field name="categ_id" widget="selection"/>
|
||||
<field name="user_id"/>
|
||||
<field name="state"/>
|
||||
<button name="case_cancel" string="Cancel" states="draft,open,pending" type="object" icon="gtk-cancel"/>
|
||||
<button name="case_open" string="Open" states="draft,pending" type="object" icon="gtk-go-forward"/>
|
||||
<button name="case_open" string="Todo" states="draft,pending" type="object" icon="gtk-go-forward"/>
|
||||
<button name="case_close" string="Held" states="open,draft,pending" type="object" icon="gtk-jump-to"/>
|
||||
<button name="case_pending" string="Not Held" states="open" type="object" icon="gtk-media-pause"/>
|
||||
</tree>
|
||||
<form string="Phone Call">
|
||||
<group colspan="6" col="7">
|
||||
<field name="name" required="1"/>
|
||||
<field name="partner_phone" attrs="{'required': [('categ_id.name', '=', 'Outbound')]}"/>
|
||||
<field name="duration" widget="float_time" required="1"/>
|
||||
<button string="Schedule a Meeting" name="action_make_meeting" icon="gtk-redo" type="object"/>
|
||||
|
||||
<field name="date" required="1"/>
|
||||
<field name="user_id"/>
|
||||
<field name="section_id" colspan="1" widget="selection" />
|
||||
<button string="Convert to Opportunity"
|
||||
name="%(phonecall2opportunity_act)d"
|
||||
icon="gtk-index" type="action"
|
||||
attrs="{'invisible':[('opportunity_id','!=',False)]}" />
|
||||
<label colspan="6" string=""/>
|
||||
<button string="Schedule Other Call"
|
||||
icon="terp-call-start"
|
||||
name="%(phonecall_to_phonecall_act)d"
|
||||
type="action" />
|
||||
|
||||
</group>
|
||||
|
||||
<group col="3" colspan="2">
|
||||
<separator colspan="3" string="Contacts" />
|
||||
<field name="partner_id"
|
||||
on_change="onchange_partner_id(partner_id, email_from)" />
|
||||
<button string="Create a Partner"
|
||||
icon="terp-partner"
|
||||
name="%(action_crm_phonecall2partner)d"
|
||||
type="action"
|
||||
attrs="{'invisible':[('partner_id','!=',False)]}"
|
||||
groups="base.group_partner_manager" />
|
||||
<newline/>
|
||||
<field name="partner_address_id"
|
||||
on_change="onchange_partner_address_id(partner_address_id, email_from)" />
|
||||
<newline/>
|
||||
<field name="partner_mobile" />
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Categorization" />
|
||||
<field name="categ_id" widget="selection"
|
||||
domain="[('object_id.model', '=', 'crm.phonecall')]"
|
||||
string="Type" />
|
||||
<field name="priority"/>
|
||||
<field name="opportunity_id"/>
|
||||
</group>
|
||||
<separator string="Description" colspan="4" />
|
||||
<field name="description" nolabel="1" colspan="4" />
|
||||
<separator colspan="4" />
|
||||
<group col="8" colspan="4">
|
||||
<field name="state" select="1" />
|
||||
<button name="case_cancel" string="Cancel"
|
||||
states="draft,open,pending" type="object"
|
||||
icon="gtk-cancel" />
|
||||
<button name="case_open" string="Open"
|
||||
states="draft,pending" type="object"
|
||||
icon="gtk-go-forward" />
|
||||
<button name="case_pending" string="Not Held"
|
||||
states="open" type="object" icon="gtk-media-pause" />
|
||||
<button name="case_close" string="Held"
|
||||
states="open,draft,pending" type="object"
|
||||
icon="gtk-jump-to" />
|
||||
<button name="case_reset" string="Reset to Draft"
|
||||
states="done,cancel" type="object"
|
||||
icon="gtk-convert" />
|
||||
</group>
|
||||
</form>
|
||||
|
||||
</field>
|
||||
</page>
|
||||
</field>
|
||||
|
||||
@@ -33,9 +33,10 @@ class crm_opportunity2phonecall(osv.osv_memory):
|
||||
'user_id' : fields.many2one('res.users', "Assign To"),
|
||||
'date': fields.datetime('Date' , required=True),
|
||||
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
|
||||
'categ_id': fields.many2one('crm.case.categ', 'Category', required=True, \
|
||||
'categ_id': fields.many2one('crm.case.categ', 'Category', \
|
||||
domain="['|',('section_id','=',False),('section_id','=',section_id),\
|
||||
('object_id.model', '=', 'crm.phonecall')]"),
|
||||
('object_id.model', '=', 'crm.phonecall')]"),
|
||||
'action': fields.selection([('schedule','Schedule a call'), ('log','Log a call')], 'Action', required=True),
|
||||
}
|
||||
|
||||
def default_get(self, cr, uid, fields, context=None):
|
||||
@@ -58,6 +59,7 @@ class crm_opportunity2phonecall(osv.osv_memory):
|
||||
|
||||
record_ids = context and context.get('active_ids', []) or []
|
||||
res = super(crm_opportunity2phonecall, self).default_get(cr, uid, fields, context=context)
|
||||
res.update({'action': 'schedule'})
|
||||
for opp in opp_obj.browse(cr, uid, record_ids, context=context):
|
||||
if 'name' in fields:
|
||||
res.update({'name': opp.name})
|
||||
@@ -112,7 +114,7 @@ class crm_opportunity2phonecall(osv.osv_memory):
|
||||
|
||||
for this in self.browse(cr, uid, ids, context=context):
|
||||
for opp in opp_obj.browse(cr, uid, record_ids, context=context):
|
||||
new_case = phonecall_obj.create(cr, uid, {
|
||||
vals = {
|
||||
'name' : opp.name,
|
||||
'case_id' : opp.id ,
|
||||
'user_id' : this.user_id and this.user_id.id or False,
|
||||
@@ -126,9 +128,12 @@ class crm_opportunity2phonecall(osv.osv_memory):
|
||||
'partner_mobile' : opp.partner_address_id and opp.partner_address_id.mobile or False,
|
||||
'priority': opp.priority,
|
||||
'opportunity_id': opp.id
|
||||
}, context=context)
|
||||
|
||||
phonecall_obj.case_open(cr, uid, [new_case])
|
||||
}
|
||||
new_case = phonecall_obj.create(cr, uid, vals, context=context)
|
||||
if this.action == 'schedule':
|
||||
phonecall_obj.case_open(cr, uid, [new_case])
|
||||
elif this.action == 'log':
|
||||
phonecall_obj.case_close(cr, uid, [new_case])
|
||||
|
||||
value = {
|
||||
'name': _('Phone Call'),
|
||||
|
||||
@@ -9,8 +9,10 @@
|
||||
<field name="model">crm.opportunity2phonecall</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Schedule a PhoneCall">
|
||||
<separator string="Schedule a PhoneCall" colspan="4"/>
|
||||
<form string="Register a call">
|
||||
<separator string="Register a call" colspan="4"/>
|
||||
<field name="action"/>
|
||||
<separator string="Call Details" colspan="4"/>
|
||||
<field name="name"/>
|
||||
<field name="date" string="Planned Date"/>
|
||||
<newline/>
|
||||
@@ -21,7 +23,7 @@
|
||||
<group colspan="4">
|
||||
<label string ="" colspan="2"/>
|
||||
<button name="action_cancel" string="_Cancel" icon="gtk-cancel" special="cancel" />
|
||||
<button name="action_apply" type="object" string="_Schedule Call" icon="gtk-ok" />
|
||||
<button name="action_apply" type="object" string="Register call" icon="gtk-ok" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
@@ -30,7 +32,7 @@
|
||||
<!-- Opportunity to Phonecall action -->
|
||||
|
||||
<record model="ir.actions.act_window" id="opportunity2phonecall_act">
|
||||
<field name="name">Schedule Call</field>
|
||||
<field name="name">Schedule/Log Call</field>
|
||||
<field name="res_model">crm.opportunity2phonecall</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
|
||||
@@ -84,6 +84,10 @@ class crm_phonecall2phonecall(osv.osv_memory):
|
||||
'date': this.date
|
||||
}
|
||||
phonecall_id = phonecall_obj.create(cr, uid, values, context=context)
|
||||
if this.action == 'schedule':
|
||||
phonecall_obj.case_open(cr, uid, [phonecall_id])
|
||||
elif this.action == 'log':
|
||||
phonecall_obj.case_close(cr, uid, [phonecall_id])
|
||||
|
||||
res = {
|
||||
'name': _('Phone Call'),
|
||||
@@ -102,11 +106,12 @@ class crm_phonecall2phonecall(osv.osv_memory):
|
||||
_columns = {
|
||||
'name' : fields.char('Call summary', size=64, required=True, select=1),
|
||||
'user_id' : fields.many2one('res.users',"Assign To"),
|
||||
'categ_id': fields.many2one('crm.case.categ', 'Category', required=True, \
|
||||
'categ_id': fields.many2one('crm.case.categ', 'Category', \
|
||||
domain="['|',('section_id','=',False),('section_id','=',section_id),\
|
||||
('object_id.model', '=', 'crm.phonecall')]"),
|
||||
'date': fields.datetime('Date', required=True),
|
||||
'section_id':fields.many2one('crm.case.section','Sales Team'),
|
||||
'action': fields.selection([('schedule','Schedule a call'), ('log','Log a call')], 'Action', required=True),
|
||||
}
|
||||
|
||||
def default_get(self, cr, uid, fields, context=None):
|
||||
@@ -122,7 +127,7 @@ class crm_phonecall2phonecall(osv.osv_memory):
|
||||
"""
|
||||
res = super(crm_phonecall2phonecall, self).default_get(cr, uid, fields, context=context)
|
||||
record_id = context and context.get('active_id', False) or False
|
||||
|
||||
res.update({'action': 'schedule'})
|
||||
if record_id:
|
||||
phonecall = self.pool.get('crm.phonecall').browse(cr, uid, record_id, context=context)
|
||||
|
||||
|
||||
@@ -9,8 +9,10 @@
|
||||
<field name="model">crm.phonecall2phonecall</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Schedule Other Call">
|
||||
<separator string="Schedule Other Call" colspan="4"/>
|
||||
<form string="Register a call">
|
||||
<separator string="Register a call" colspan="4"/>
|
||||
<field name="action"/>
|
||||
<separator string="Call Details" colspan="4"/>
|
||||
<field name="name"/>
|
||||
<field name="date" string="Planned Date"/>
|
||||
<field name="user_id" />
|
||||
@@ -20,7 +22,7 @@
|
||||
<group colspan="4" col="3" >
|
||||
<label string=" " />
|
||||
<button name="action_cancel" string="_Cancel" icon="gtk-cancel" special="cancel" />
|
||||
<button name="action_apply" type="object" string="_Schedule" icon="gtk-go-forward" />
|
||||
<button name="action_apply" type="object" string="Register call" icon="gtk-ok" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user