Compare commits
No commits in common. "f71e6f4671f080a706d657fbee421431c5041dad" and "e97e8fa99dc7f58c5d6f78becde84a341cce56d4" have entirely different histories.
f71e6f4671
...
e97e8fa99d
@ -14,8 +14,8 @@ def register():
|
||||
Pool.register(
|
||||
user.User,
|
||||
pending_call.PendingCall,
|
||||
pending_call.PendingTask,
|
||||
call.Call,
|
||||
call.PendingTask,
|
||||
department.Department,
|
||||
city.City,
|
||||
prospect.ContactMethod,
|
||||
|
38
call.py
38
call.py
@ -1,6 +1,7 @@
|
||||
from trytond.model import ModelSQL, ModelView, fields
|
||||
from trytond.pyson import Eval
|
||||
from datetime import date
|
||||
|
||||
|
||||
from .selections.interest import Interest
|
||||
from .selections.call_types import CallTypes
|
||||
from .selections.call_results import CallResults
|
||||
@ -46,38 +47,3 @@ class Call(ModelSQL, ModelView):
|
||||
@classmethod
|
||||
def default_date(cls):
|
||||
return date.today()
|
||||
|
||||
|
||||
class PendingTask(ModelSQL, ModelView):
|
||||
'Tarea a realizar a un seguimiento de prospecto'
|
||||
__name__ = "sale.pending_task"
|
||||
|
||||
description = fields.Text('Description', required=True)
|
||||
state = fields.Selection(
|
||||
[('pending', 'Pending'),
|
||||
('done', 'Done')],
|
||||
'State')
|
||||
|
||||
prospect_trace = fields.Many2One(
|
||||
'sale.prospect_trace', 'Prospect trace',
|
||||
required=True, readonly=True)
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(PendingTask, cls).__setup__()
|
||||
cls._buttons.update({
|
||||
'close_task': {
|
||||
'invisible': Eval('state') == 'done'
|
||||
}
|
||||
})
|
||||
|
||||
@classmethod
|
||||
@ModelView.button
|
||||
def close_task(cls, tasks):
|
||||
for task in tasks:
|
||||
task.state = 'done'
|
||||
task.save()
|
||||
|
||||
@classmethod
|
||||
def default_state(cls):
|
||||
return 'pending'
|
||||
|
5
call.xml
5
call.xml
@ -105,10 +105,5 @@ this repository contains the full copyright notices and license terms. -->
|
||||
id="menu_pending_tasks"
|
||||
action="act_pending_task_tree"
|
||||
icon="tryton-graph"/>
|
||||
<record model="ir.model.button" id="close_task_button">
|
||||
<field name="name">close_task</field>
|
||||
<field name="string">Close task</field>
|
||||
<field name="model" search="[('model', '=', 'sale.pending_task')]"/>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
||||
|
@ -12,3 +12,18 @@ class PendingCall(ModelSQL, ModelView):
|
||||
def get_rec_name(self, name):
|
||||
if self.date:
|
||||
return str(self.date)
|
||||
|
||||
|
||||
class PendingTask(ModelSQL, ModelView):
|
||||
'Tarea pendiente a un seguimiento de prospecto'
|
||||
__name__ = "sale.pending_task"
|
||||
|
||||
description = fields.Text('Description', required=True)
|
||||
done = fields.Boolean('Done')
|
||||
prospect_trace = fields.Many2One(
|
||||
'sale.prospect_trace', 'Prospect trace',
|
||||
required=True, readonly=True)
|
||||
|
||||
@classmethod
|
||||
def default_done(cls):
|
||||
return False
|
||||
|
@ -265,7 +265,7 @@ Crear una llamada agendada previamente::
|
||||
>>> prospect_trace.state
|
||||
'open'
|
||||
|
||||
Hacer llamada y programar tarea::
|
||||
Hacer llamada y programar tarea
|
||||
>>> make_call = Wizard('sale.prospect_trace.make_call', [prospect_trace])
|
||||
>>> make_call.form.description = 'Prospect told me to send him an email'
|
||||
>>> make_call.form.interest = '3'
|
||||
@ -282,13 +282,6 @@ Hacer llamada y programar tarea::
|
||||
>>> task
|
||||
proteus.Model.get('sale.pending_task')(1)
|
||||
|
||||
>>> task.state
|
||||
'pending'
|
||||
|
||||
>>> task.click('close_task')
|
||||
>>> task.state
|
||||
'done'
|
||||
|
||||
Hacer llamada y cerrar venta (Seguimiento de prospecto)::
|
||||
>>> make_call = Wizard('sale.prospect_trace.make_call', [prospect_trace])
|
||||
>>> make_call.form.description = 'Closed sale'
|
||||
|
@ -4,5 +4,4 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<tree>
|
||||
<field name="prospect_trace" expand="1"/>
|
||||
<field name="description" expand="1"/>
|
||||
<button name="close_task"/>
|
||||
</tree>
|
Loading…
Reference in New Issue
Block a user