From d1def24dd63ec1d51574312a403c3441835f5c19 Mon Sep 17 00:00:00 2001 From: camilogs Date: Fri, 28 Jul 2023 03:00:30 +0000 Subject: [PATCH] Se crea modelo de llamada y se hace valida fecha por defecto = hoy --- __init__.py | 2 ++ call.py | 13 +++++++++++++ tests/scenario_sale_opportunity_management.rst | 14 +++++++++++++- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 call.py diff --git a/__init__.py b/__init__.py index 387eb22..0563194 100644 --- a/__init__.py +++ b/__init__.py @@ -1,12 +1,14 @@ from trytond.pool import Pool from . import prospect from . import prospect_trace +from . import call __all__ = ['register'] def register(): Pool.register( + call.Call, prospect.Prospect, prospect_trace.ProspectTrace, module='sale_opportunity_management', type_='model') diff --git a/call.py b/call.py new file mode 100644 index 0000000..d185354 --- /dev/null +++ b/call.py @@ -0,0 +1,13 @@ +from trytond.model import ModelSQL, ModelView, fields +from datetime import date + +class Call(ModelSQL, ModelView): + 'Llamada' + + __name__ = 'sale.call' + + date = fields.Date('Fecha', ) + + @classmethod + def default_date(cls): + return date.today() \ No newline at end of file diff --git a/tests/scenario_sale_opportunity_management.rst b/tests/scenario_sale_opportunity_management.rst index 9336afa..cd2cd2d 100644 --- a/tests/scenario_sale_opportunity_management.rst +++ b/tests/scenario_sale_opportunity_management.rst @@ -6,6 +6,7 @@ Imports:: >>> from proteus import Model, Wizard >>> from trytond.tests.tools import activate_modules + >>> from datetime import date Activate modules:: @@ -35,4 +36,15 @@ Crear seguimiento de prospecto:: >>> prospect_trace.prospect_name 'guchito S.A.S' >>> prospect_trace.prospect_tel - 3123423422 \ No newline at end of file + 3123423422 + +---------------------------------------------------------------------------- +Como operador quiero poder registrar una llamada para luego generar reportes +---------------------------------------------------------------------------- + +Crear llamada a un seguimiento de prospecto:: + >>> Call = Model.get('sale.call') + >>> call = Call() + + >>> call.date == date.today() + True