From 6b972da26bb79439664a77673c6e8d6d2667d0b3 Mon Sep 17 00:00:00 2001 From: camilogs Date: Sat, 5 Aug 2023 17:14:23 -0500 Subject: [PATCH] =?UTF-8?q?feat:=20Se=20configura=20creaci=C3=B3n=20de=20c?= =?UTF-8?q?iudades=20y=20departamentos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locations/{city.xml => cities.xml} | 0 locations/city.py | 1 + tests/scenario_sale_opportunity_management.rst | 16 +--------------- tryton.cfg | 4 +++- 4 files changed, 5 insertions(+), 16 deletions(-) rename locations/{city.xml => cities.xml} (100%) diff --git a/locations/city.xml b/locations/cities.xml similarity index 100% rename from locations/city.xml rename to locations/cities.xml diff --git a/locations/city.py b/locations/city.py index 859bcc1..43e0631 100644 --- a/locations/city.py +++ b/locations/city.py @@ -8,4 +8,5 @@ class City(ModelSQL, ModelView): __name__ = 'sale.city' name = fields.Char('City') + code = fields.Char('Code') parent = fields.Many2One('sale.department', 'Departamento') diff --git a/tests/scenario_sale_opportunity_management.rst b/tests/scenario_sale_opportunity_management.rst index 810496b..dd85eb0 100644 --- a/tests/scenario_sale_opportunity_management.rst +++ b/tests/scenario_sale_opportunity_management.rst @@ -40,21 +40,6 @@ El administrador deberá poder registrar los contactos de diferentes prospectos, * Nombre * Cargo -Crear departamentos y ciudades: - >>> Department = Model.get('sale.department') - >>> antioquia = Department() - >>> antioquia.name = 'Antioquia' - >>> antioquia.code = 'CO-05' - >>> antioquia.save() - >>> City = Model.get('sale.city') - >>> medellin = City() - >>> medellin.name = 'Medellín' - >>> antioquia, = Department.find(['code', '=', 'CO-05']) - >>> medellin.parent = antioquia - >>> medellin.save() - >>> medellin.parent.name - 'Antioquia' - Crear prospecto:: >>> Prospect = Model.get('sale.prospect') >>> prospect = Prospect() @@ -63,6 +48,7 @@ Crear prospecto:: >>> contact_method = prospect.contact_methods.new(contact_type = 'mobile', value = '31223425234') >>> contact_method = prospect.contact_methods.new(contact_type = 'mail', value = 'peralto@guchitos.org') >>> prospect.save() + >>> prospect.contact_methods [proteus.Model.get('prospect.contact_method')(1), proteus.Model.get('prospect.contact_method')(2)] diff --git a/tryton.cfg b/tryton.cfg index 6bbca40..78183aa 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -6,4 +6,6 @@ depends: xml: call.xml prospect_trace.xml - prospect.xml \ No newline at end of file + prospect.xml + ./locations/departments.xml + ./locations/cities.xml \ No newline at end of file