add new fields

This commit is contained in:
wilson gomez 2022-01-04 10:44:42 -05:00
parent cd166be826
commit 5f8f6d05ea
3 changed files with 103 additions and 5 deletions

View file

@ -26,6 +26,31 @@ STATES_CLOSE = {
'required': (Eval('state') == 'close'),
}
OPTION_SELECT = [
('', ''),
('yes', 'Yes'),
('no', 'No'),
]
SEXUAL_DIVERSITY = [
('', ''),
('', 'HETEROSEXUAL'),
('', 'GAY'),
('', 'LESBIANA'),
('', 'TRAVESTI'),
('', 'BISEXUAL')
]
ETHNICAL_GROUP = [
('', ''),
('afrocolombiano', 'AFROCOLOMBIANO'),
('palenquero', 'PALENQUERO'),
('indigena', 'INDÍGENA'),
('raizal', 'RAIZAL'),
('rom_gitano', 'ROM O GITANO'),
('mulato', 'MULATO'),
]
class CustomerService(Workflow, ModelSQL, ModelView):
'Customer Service'
@ -64,11 +89,7 @@ class CustomerService(Workflow, ModelSQL, ModelView):
('id', If(In('company',
Eval('context', {})), '=', '!='), Get(Eval('context', {}),
'company', 0)), ])
satisfaction = fields.Selection([
('', ''),
('yes', 'Yes'),
('no', 'No'),
], 'Satisfaction', states=STATES_CLOSE, depends=['state'])
satisfaction = fields.Selection(OPTION_SELECT, 'Satisfaction', states=STATES_CLOSE, depends=['state'])
satisfaction_string = satisfaction.translated('satisfaction')
notes = fields.Text('Notes', states=STATES_CLOSE)
efficacy = fields.Function(fields.Selection([
@ -98,6 +119,16 @@ class CustomerService(Workflow, ModelSQL, ModelView):
('other', 'Other'),
], 'Media', states=STATES)
action_plan = fields.Text('Action Plan', states=STATES_CLOSE)
detailed_especific = fields.Char('Detailed Especific')
ethnical_group = fields.selection(ETHNICAL_GROUP, 'Ethnical Group')
sexual_diversity = fields.selection(SEXUAL_DIVERSITY, 'Sexual Diversity')
displaced = fields.selection(OPTION_SELECT, 'Displaced')
victim_of_violence = fields.selection(OPTION_SELECT, 'Victim Of Violence')
disabled_person = fields.selection(OPTION_SELECT, 'Disabled Person')
pregnant_woman = fields.selection(OPTION_SELECT, 'Pregnan Woman')
homeless = fields.selection(OPTION_SELECT, 'Homeless')
deprived_of_freedom = fields.selection(OPTION_SELECT, 'Deprived Of Freedom')
age = fields.Function(fields.Char('Age'), 'get_age')
@classmethod
def __setup__(cls):
@ -143,6 +174,10 @@ class CustomerService(Workflow, ModelSQL, ModelView):
def default_efficacy():
return 'on_time'
def get_age(self):
if self.party:
self.age = self.party.age
@classmethod
@ModelView.button
@Workflow.transition('open')

View file

@ -226,6 +226,46 @@ msgctxt "field:crm.customer_service,effective_date:"
msgid "Effective Datetime"
msgstr "Fecha de Respuesta"
msgctxt "field:crm.customer_service,age:"
msgid "Age"
msgstr "Edad"
msgctxt "field:crm.customer_service,ethnical_group:"
msgid "Ethnical Group"
msgstr "Grupo Etnico"
msgctxt "field:crm.customer_service,sexual_diversity:"
msgid "Sexual Diversity"
msgstr "Diversidad Sexual"
msgctxt "field:crm.customer_service,displaced:"
msgid "Displaced"
msgstr "Desplazado"
msgctxt "field:crm.customer_service,victim_of_violence:"
msgid "Victim Of Violence"
msgstr "Victima de Violencia"
msgctxt "field:crm.customer_service,disabled_person:"
msgid "Disabled Person"
msgstr "Persona con Discapacidad"
msgctxt "field:crm.customer_service,pregnant_woman:"
msgid "Pregnant Woman"
msgstr "Mujer en Gestaciòn"
msgctxt "field:crm.customer_service,homeless:"
msgid "Homeless"
msgstr "Habitante de Calle"
msgctxt "field:crm.customer_service,deprived_of_freedom:"
msgid "Deprived Of Freedom"
msgstr "Privado de Libertad"
msgctxt "field:crm.customer_service,detailed_especific:"
msgid "Detailed Especific"
msgstr "Detalle Especifico"
msgctxt "field:crm.customer_service,efficacy:"
msgid "Efficacy"
msgstr "Efficacia"

View file

@ -46,6 +46,29 @@ this repository contains the full copyright notices and license terms. -->
<field name="company"/>
<label name="efficacy"/>
<field name="efficacy"/>
<label name="detailed_especific"/>
<field name="detailed_especific" colspan="3"/>
<label name="age"/>
<field name="age"/>
<label name="ethnical_group"/>
<field name="ethnical_group"/>
<label name="sexual_diversity"/>
<field name="sexual_diversity"/>
<group id='special_population' string='Special Population'>
<label name="displaced"/>
<field name="displaced"/>
<label name="victim_of_violence"/>
<field name="victim_of_violence"/>
<label name="disabled_person"/>
<field name="disabled_person"/>
<label name="pregnant_woman"/>
<field name="pregnant_woman"/>
<label name="homeless"/>
<field name="homeless"/>
<label name="deprived_of_freedom"/>
<field name="deprived_of_freedom"/>
</group>
<separator name="notes" colspan="4"/>
<field name="notes" colspan="4"/>
</page>