Compare commits
4 Commits
modulariza
...
a1d1e019ec
| Author | SHA1 | Date | |
|---|---|---|---|
| a1d1e019ec | |||
| 3be97677a7 | |||
| 5873d35f12 | |||
| 85d5f714ef |
@@ -28,6 +28,7 @@ def register():
|
|||||||
prospect_trace.MakeCallAskTask,
|
prospect_trace.MakeCallAskTask,
|
||||||
prospect.ReassignProspectByOperatorStart,
|
prospect.ReassignProspectByOperatorStart,
|
||||||
prospect.ReassignProspectByProspectStart,
|
prospect.ReassignProspectByProspectStart,
|
||||||
|
call.PendingTask_ContactMethod,
|
||||||
module='sale_opportunity_management', type_='model')
|
module='sale_opportunity_management', type_='model')
|
||||||
Pool.register(
|
Pool.register(
|
||||||
prospect_trace.ScheduleCall,
|
prospect_trace.ScheduleCall,
|
||||||
|
|||||||
14
call.py
14
call.py
@@ -67,6 +67,11 @@ class PendingTask(ModelSQL, ModelView):
|
|||||||
'sale.prospect_trace', 'Prospect trace',
|
'sale.prospect_trace', 'Prospect trace',
|
||||||
required=True, readonly=True)
|
required=True, readonly=True)
|
||||||
|
|
||||||
|
contacts = fields.Many2Many(
|
||||||
|
'sale.pendingtask_contactmethod',
|
||||||
|
'pending_task_id', 'contact_method_id',
|
||||||
|
'Contact Methods')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def __setup__(cls):
|
def __setup__(cls):
|
||||||
super(PendingTask, cls).__setup__()
|
super(PendingTask, cls).__setup__()
|
||||||
@@ -86,3 +91,12 @@ class PendingTask(ModelSQL, ModelView):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def default_state(cls):
|
def default_state(cls):
|
||||||
return 'pending'
|
return 'pending'
|
||||||
|
|
||||||
|
|
||||||
|
class PendingTask_ContactMethod(ModelSQL):
|
||||||
|
'Relacion muchos a muchos entre tareas pendientes y mecanismos de contacto'
|
||||||
|
__name__ = "sale.pendingtask_contactmethod"
|
||||||
|
|
||||||
|
pending_task_id = fields.Many2One('sale.pending_task', 'Pending task id')
|
||||||
|
contact_method_id = fields.Many2One(
|
||||||
|
'prospect.contact_method', 'Contact method id')
|
||||||
|
|||||||
@@ -80,6 +80,11 @@ class ContactMethod(ModelSQL, ModelView):
|
|||||||
prospect_trace = fields.Many2One(
|
prospect_trace = fields.Many2One(
|
||||||
'sale.prospect_trace', 'Prospect Trace', required=False)
|
'sale.prospect_trace', 'Prospect Trace', required=False)
|
||||||
|
|
||||||
|
tasks = fields.Many2Many(
|
||||||
|
'sale.pendingtask_contactmethod',
|
||||||
|
'contact_method_id', 'pending_task_id',
|
||||||
|
'Contact Methods')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def default_contact_type(cls):
|
def default_contact_type(cls):
|
||||||
return 'mobile'
|
return 'mobile'
|
||||||
|
|||||||
@@ -263,6 +263,7 @@ class MakeCall(Wizard):
|
|||||||
task = Task()
|
task = Task()
|
||||||
task.description = description
|
task.description = description
|
||||||
task.prospect_trace = prospect_trace
|
task.prospect_trace = prospect_trace
|
||||||
|
task.contacts = prospect_trace.prospect_contacts
|
||||||
task.save()
|
task.save()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -287,16 +287,42 @@ Hacer llamada y programar tarea::
|
|||||||
>>> make_call.execute('schedule_task')
|
>>> make_call.execute('schedule_task')
|
||||||
|
|
||||||
>>> Task = Model.get('sale.pending_task')
|
>>> Task = Model.get('sale.pending_task')
|
||||||
>>> task, = Task.find([('description', '=', 'I have to send a mail to prospect offering him this services...')])
|
>>> task1, = Task.find([('description', '=', 'I have to send a mail to prospect offering him this services...')])
|
||||||
>>> task
|
|
||||||
proteus.Model.get('sale.pending_task')(1)
|
|
||||||
|
|
||||||
>>> task.state
|
>>> task1
|
||||||
|
proteus.Model.get('sale.pending_task')(1)
|
||||||
|
>>> task1.state
|
||||||
'pending'
|
'pending'
|
||||||
|
|
||||||
>>> task.click('close_task')
|
>>> task1.click('close_task')
|
||||||
>>> task.state
|
|
||||||
|
>>> task1.state
|
||||||
'done'
|
'done'
|
||||||
|
>>> task1.contacts[0].value
|
||||||
|
'12345678910'
|
||||||
|
|
||||||
|
Programar segunda tarea al mismo seguimiento::
|
||||||
|
>>> make_call = Wizard('sale.prospect_trace.make_call', [prospect_trace])
|
||||||
|
>>> make_call.form.description = 'Prospect told me to send him an SMS'
|
||||||
|
>>> make_call.form.interest = '3'
|
||||||
|
>>> make_call.form.schedule_call = 'no'
|
||||||
|
>>> make_call.form.schedule_task = 'yes'
|
||||||
|
>>> make_call.execute('make_call')
|
||||||
|
>>> make_call.form.task_description = 'I have to send a SMS to prospect offering him this services...'
|
||||||
|
>>> make_call.execute('schedule_task')
|
||||||
|
|
||||||
|
>>> task1.save()
|
||||||
|
>>> Task = Model.get('sale.pending_task')
|
||||||
|
>>> task2, = Task.find([('description', '=', 'I have to send a SMS to prospect offering him this services...')])
|
||||||
|
>>> task2
|
||||||
|
proteus.Model.get('sale.pending_task')(2)
|
||||||
|
|
||||||
|
>>> task2.state
|
||||||
|
'pending'
|
||||||
|
>>> task2.contacts[0].value
|
||||||
|
'12345678910'
|
||||||
|
>>> task1.contacts[0].value
|
||||||
|
'12345678910'
|
||||||
|
|
||||||
Hacer llamada y cerrar venta (Seguimiento de prospecto)::
|
Hacer llamada y cerrar venta (Seguimiento de prospecto)::
|
||||||
>>> make_call = Wizard('sale.prospect_trace.make_call', [prospect_trace])
|
>>> make_call = Wizard('sale.prospect_trace.make_call', [prospect_trace])
|
||||||
@@ -348,7 +374,6 @@ Reasignar prospectos por prospecto::
|
|||||||
>>> reassign_by_prospect.form.new_operator = user
|
>>> reassign_by_prospect.form.new_operator = user
|
||||||
>>> reassign_by_prospect.execute('reassign_by_prospect')
|
>>> reassign_by_prospect.execute('reassign_by_prospect')
|
||||||
|
|
||||||
|
|
||||||
>>> prospect1.reload()
|
>>> prospect1.reload()
|
||||||
>>> prospect1.assigned_operator.name
|
>>> prospect1.assigned_operator.name
|
||||||
'Administrator'
|
'Administrator'
|
||||||
|
|||||||
@@ -8,5 +8,8 @@ this repository contains the full copyright notices and license terms. -->
|
|||||||
<newline/>
|
<newline/>
|
||||||
<label name="description"/>
|
<label name="description"/>
|
||||||
<field name="description"/>
|
<field name="description"/>
|
||||||
|
<newline/>
|
||||||
|
<label name="contacts"/>
|
||||||
|
<field name="contacts"/>
|
||||||
</group>
|
</group>
|
||||||
</form>
|
</form>
|
||||||
@@ -4,5 +4,6 @@ this repository contains the full copyright notices and license terms. -->
|
|||||||
<tree>
|
<tree>
|
||||||
<field name="prospect_trace" expand="1"/>
|
<field name="prospect_trace" expand="1"/>
|
||||||
<field name="description" expand="1"/>
|
<field name="description" expand="1"/>
|
||||||
|
<field name="contacts" expand="1"/>
|
||||||
<button name="close_task"/>
|
<button name="close_task"/>
|
||||||
</tree>
|
</tree>
|
||||||
Reference in New Issue
Block a user