Se crea modelo de llamada y se hace valida fecha por defecto = hoy

This commit is contained in:
Camilo Gonzalez 2023-07-28 03:00:30 +00:00
parent f9f929ae1e
commit d1def24dd6
3 changed files with 28 additions and 1 deletions

View File

@ -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')

13
call.py Normal file
View File

@ -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()

View File

@ -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
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