From 21fc7a7bcd503f1d07bbd07d28055d5347e6742c Mon Sep 17 00:00:00 2001 From: camilogs Date: Tue, 8 Aug 2023 16:25:46 -0500 Subject: [PATCH] =?UTF-8?q?chore:=20Se=20hace=20obligatorio=20mecanismo=20?= =?UTF-8?q?de=20contacto=20en=20creaci=C3=B3n=20de=20prospecto,=20#19?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prospect.py | 3 ++- tests/test_module.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/prospect.py b/prospect.py index 4f65a32..e8b31f6 100644 --- a/prospect.py +++ b/prospect.py @@ -12,7 +12,8 @@ class Prospect(ModelSQL, ModelView): name = fields.Char('Name') contact_methods = fields.One2Many( - 'prospect.contact_method', 'prospect', 'Contact methods') + 'prospect.contact_method', + 'prospect', 'Contact methods', required=True) department = fields.Many2One('sale.department', 'Department') city = fields.Many2One('sale.city', 'City', diff --git a/tests/test_module.py b/tests/test_module.py index 96e7972..cc89333 100644 --- a/tests/test_module.py +++ b/tests/test_module.py @@ -12,5 +12,11 @@ class SaleOpportunityManagementTestCase(ModuleTestCase): ProspectTrace = pool.get('sale.prospect_trace') self.assertTrue(ProspectTrace.prospect.required) + @with_transaction() + def test_contact_method_en_prospect_es_obligatorio(self): + pool = Pool() + Prospect = pool.get('sale.prospect') + self.assertTrue(Prospect.contact_methods.required) + del ModuleTestCase