From c6cde388691089d31ed07c9a21b92e86f1b6f2dc Mon Sep 17 00:00:00 2001 From: Camilo Sarmiento Date: Mon, 28 Sep 2020 10:54:15 -0500 Subject: [PATCH] add field classification --- customer_service.py | 10 ++++++++++ view/customer_service_form.xml | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/customer_service.py b/customer_service.py index 4945537..58673f1 100644 --- a/customer_service.py +++ b/customer_service.py @@ -24,6 +24,12 @@ NEW_MEDIA = new_sel = [ ('supersalud', 'Supersalud'), ] +CLASSIFICATION = new_sel = [ + ('', ''), + ('riesgo_vida', 'Riesgo de Vida'), + ('regular', 'Regular'), +] + class ReceiverService(ModelSQL, ModelView): 'Receicer Service' @@ -111,6 +117,10 @@ class CustomerService(metaclass=PoolMeta): 'customer_service', 'Receivers') others_receivers_string = fields.Function(fields.Char('Others Receicers'), 'get_others_receivers_string') + classification = fields.Selection(CLASSIFICATION, 'Classification', states={ + 'required': (Eval('media') == 'supersalud'), + 'invisible': (Eval('media') != 'supersalud'), + }) @classmethod def __setup__(cls): diff --git a/view/customer_service_form.xml b/view/customer_service_form.xml index 312eb39..7ec4c3f 100644 --- a/view/customer_service_form.xml +++ b/view/customer_service_form.xml @@ -88,6 +88,11 @@ this repository contains the full copyright notices and license terms. --> + +