trytondo-sale_opportunity_m.../call.py
camilogs bdcf78ad56
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
chore: En registros de llamadas se renombra 'operario asignado' por 'operario que llamó'
2023-08-28 20:27:30 -05:00

50 lines
1.4 KiB
Python

from trytond.model import ModelSQL, ModelView, fields
from datetime import date
from .selections.interest import Interest
from .selections.call_types import CallTypes
from .selections.call_results import CallResults
class Call(ModelSQL, ModelView):
'Llamada'
__name__ = 'sale.call'
_order_name = 'date'
_states = {'readonly': True}
date = fields.Date('Date', states=_states)
description = fields.Text('Description', strip=True)
prospect_trace = fields.Many2One(
'sale.prospect_trace', 'Prospect trace', required=True, states=_states)
interest = fields.Selection(
Interest.get_interest_levels(), 'Interest', required=True)
call_type = fields.Selection(
CallTypes.get_call_types(), 'Call type', states=_states)
call_result = fields.Selection(
CallResults.get_call_results(),
'Call result', states=_states)
call_business_unit = fields.Selection(
[('brigade', 'Brigade'),
('optics', 'Optics'),
('equipment', 'Equipment')],
'Business unit', states=_states
)
operator_who_called = fields.Many2One(
'res.user', "Operator who called", states=_states)
@classmethod
def __setup__(cls):
super(Call, cls).__setup__()
cls._order = [
('date', 'DESC NULLS FIRST')
]
@classmethod
def default_date(cls):
return date.today()