Compare commits

..

No commits in common. "f71e6f4671f080a706d657fbee421431c5041dad" and "e97e8fa99dc7f58c5d6f78becde84a341cce56d4" have entirely different histories.

6 changed files with 19 additions and 51 deletions

View File

@ -14,8 +14,8 @@ def register():
Pool.register( Pool.register(
user.User, user.User,
pending_call.PendingCall, pending_call.PendingCall,
pending_call.PendingTask,
call.Call, call.Call,
call.PendingTask,
department.Department, department.Department,
city.City, city.City,
prospect.ContactMethod, prospect.ContactMethod,

38
call.py
View File

@ -1,6 +1,7 @@
from trytond.model import ModelSQL, ModelView, fields from trytond.model import ModelSQL, ModelView, fields
from trytond.pyson import Eval
from datetime import date from datetime import date
from .selections.interest import Interest from .selections.interest import Interest
from .selections.call_types import CallTypes from .selections.call_types import CallTypes
from .selections.call_results import CallResults from .selections.call_results import CallResults
@ -46,38 +47,3 @@ class Call(ModelSQL, ModelView):
@classmethod @classmethod
def default_date(cls): def default_date(cls):
return date.today() 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'

View File

@ -105,10 +105,5 @@ this repository contains the full copyright notices and license terms. -->
id="menu_pending_tasks" id="menu_pending_tasks"
action="act_pending_task_tree" action="act_pending_task_tree"
icon="tryton-graph"/> 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> </data>
</tryton> </tryton>

View File

@ -12,3 +12,18 @@ class PendingCall(ModelSQL, ModelView):
def get_rec_name(self, name): def get_rec_name(self, name):
if self.date: if self.date:
return str(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

View File

@ -265,7 +265,7 @@ Crear una llamada agendada previamente::
>>> prospect_trace.state >>> prospect_trace.state
'open' 'open'
Hacer llamada y programar tarea:: Hacer llamada y programar tarea
>>> make_call = Wizard('sale.prospect_trace.make_call', [prospect_trace]) >>> 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.description = 'Prospect told me to send him an email'
>>> make_call.form.interest = '3' >>> make_call.form.interest = '3'
@ -282,13 +282,6 @@ Hacer llamada y programar tarea::
>>> task >>> task
proteus.Model.get('sale.pending_task')(1) 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):: 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])
>>> make_call.form.description = 'Closed sale' >>> make_call.form.description = 'Closed sale'

View File

@ -4,5 +4,4 @@ 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"/>
<button name="close_task"/>
</tree> </tree>