feat(ProspectTrace): Se hace visible unidad de negocio, actualizandose al seleccionar prospecto, #56
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				ci/woodpecker/push/woodpecker Pipeline was successful
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	ci/woodpecker/push/woodpecker Pipeline was successful
				
			This commit is contained in:
		@@ -17,7 +17,7 @@ class Prospect(ModelSQL, ModelView):
 | 
				
			|||||||
        [('brigade', 'Brigade'),
 | 
					        [('brigade', 'Brigade'),
 | 
				
			||||||
         ('optics', 'Optics'),
 | 
					         ('optics', 'Optics'),
 | 
				
			||||||
         ('equipment', 'Equipment')],
 | 
					         ('equipment', 'Equipment')],
 | 
				
			||||||
        'Business unit'
 | 
					        'Business unit', required=True
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    contact_methods = fields.One2Many(
 | 
					    contact_methods = fields.One2Many(
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,6 +16,13 @@ class ProspectTrace(DeactivableMixin, ModelSQL, ModelView):
 | 
				
			|||||||
    _states = {'readonly': True}
 | 
					    _states = {'readonly': True}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    prospect = fields.Many2One('sale.prospect', 'Prospect', required=True)
 | 
					    prospect = fields.Many2One('sale.prospect', 'Prospect', required=True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    prospect_business_unit = fields.Selection(
 | 
				
			||||||
 | 
					        [('brigade', 'Brigade'),
 | 
				
			||||||
 | 
					         ('optics', 'Optics'),
 | 
				
			||||||
 | 
					         ('equipment', 'Equipment')],
 | 
				
			||||||
 | 
					        'Business unit', states=_states
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
    prospect_contact = fields.Many2One(
 | 
					    prospect_contact = fields.Many2One(
 | 
				
			||||||
        'prospect.contact_method', 'Contact method',
 | 
					        'prospect.contact_method', 'Contact method',
 | 
				
			||||||
        domain=[('prospect', '=', Eval('prospect'))])
 | 
					        domain=[('prospect', '=', Eval('prospect'))])
 | 
				
			||||||
@@ -70,11 +77,12 @@ class ProspectTrace(DeactivableMixin, ModelSQL, ModelView):
 | 
				
			|||||||
        if not self.prospect:
 | 
					        if not self.prospect:
 | 
				
			||||||
            self.prospect_city = None
 | 
					            self.prospect_city = None
 | 
				
			||||||
            self.prospect_contact = None
 | 
					            self.prospect_contact = None
 | 
				
			||||||
 | 
					            self.prospect_business_unit = None
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.prospect_city = self.prospect.city
 | 
					        self.prospect_city = self.prospect.city
 | 
				
			||||||
 | 
					        self.prospect_business_unit = self.prospect.business_unit
 | 
				
			||||||
        mobile_contact = self._get_prospect_mobile_contact()
 | 
					        mobile_contact = self._get_prospect_mobile_contact()
 | 
				
			||||||
 | 
					 | 
				
			||||||
        if mobile_contact:
 | 
					        if mobile_contact:
 | 
				
			||||||
            self.prospect_contact = mobile_contact
 | 
					            self.prospect_contact = mobile_contact
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -185,6 +185,8 @@ Crear seguimiento de prospecto::
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    >>> prospect_trace.prospect.name
 | 
					    >>> prospect_trace.prospect.name
 | 
				
			||||||
    'guchito S.A.S'
 | 
					    'guchito S.A.S'
 | 
				
			||||||
 | 
					    >>> prospect_trace.prospect_business_unit
 | 
				
			||||||
 | 
					    'brigade'
 | 
				
			||||||
    >>> prospect_trace.prospect_city.name
 | 
					    >>> prospect_trace.prospect_city.name
 | 
				
			||||||
    'Medellín'
 | 
					    'Medellín'
 | 
				
			||||||
    >>> prospect_trace.prospect_contact.value
 | 
					    >>> prospect_trace.prospect_contact.value
 | 
				
			||||||
@@ -194,7 +196,7 @@ Crear seguimiento de prospecto::
 | 
				
			|||||||
    >>> prospect_trace.prospect_contact.job
 | 
					    >>> prospect_trace.prospect_contact.job
 | 
				
			||||||
    'Gerente R.H'
 | 
					    'Gerente R.H'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Crear llamadas a un seguimiento de prospecto desde el seguimiento de prospecto::
 | 
					Crear llamadas a un seguimiento de prospecto::
 | 
				
			||||||
    >>> make_call = Wizard('sale.prospect_trace.make_call', [prospect_trace])
 | 
					    >>> make_call = Wizard('sale.prospect_trace.make_call', [prospect_trace])
 | 
				
			||||||
    >>> make_call.form.description = 'First call to the prospect'
 | 
					    >>> make_call.form.description = 'First call to the prospect'
 | 
				
			||||||
    >>> make_call.form.interest = '0'
 | 
					    >>> make_call.form.interest = '0'
 | 
				
			||||||
@@ -259,10 +261,11 @@ Cuando se asigna prospecto sin método de contacto mobile, el contacto en el seg
 | 
				
			|||||||
    >>> prospect4.save()
 | 
					    >>> prospect4.save()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    >>> prospect_trace2 = ProspectTrace()
 | 
					    >>> prospect_trace2 = ProspectTrace()
 | 
				
			||||||
    >>> prospect_trace2.prospect = prospect2
 | 
					    >>> prospect_trace2.prospect = prospect4
 | 
				
			||||||
 | 
					 | 
				
			||||||
    >>> prospect_trace2.save()
 | 
					    >>> prospect_trace2.save()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    >>> prospect_trace2.prospect_contact
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--------
 | 
					--------
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,6 +24,12 @@ class RequiredValuesTestCase(ModuleTestCase):
 | 
				
			|||||||
        Prospect = pool.get('sale.prospect')
 | 
					        Prospect = pool.get('sale.prospect')
 | 
				
			||||||
        self.assertTrue(Prospect.name.required)
 | 
					        self.assertTrue(Prospect.name.required)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @with_transaction()
 | 
				
			||||||
 | 
					    def test_bussiness_unit_en_Prospect_es_obligatorio(self):
 | 
				
			||||||
 | 
					        pool = Pool()
 | 
				
			||||||
 | 
					        Prospect = pool.get('sale.prospect')
 | 
				
			||||||
 | 
					        self.assertTrue(Prospect.business_unit.required)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @with_transaction()
 | 
					    @with_transaction()
 | 
				
			||||||
    def test_value_en_ContactMethod_es_obligatorio(self):
 | 
					    def test_value_en_ContactMethod_es_obligatorio(self):
 | 
				
			||||||
        pool = Pool()
 | 
					        pool = Pool()
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,6 +5,8 @@ this repository contains the full copyright notices and license terms. -->
 | 
				
			|||||||
    <group col="6" colspan="5" id="header" yalign="0">
 | 
					    <group col="6" colspan="5" id="header" yalign="0">
 | 
				
			||||||
        <label name="prospect"/>
 | 
					        <label name="prospect"/>
 | 
				
			||||||
        <field name="prospect"/>
 | 
					        <field name="prospect"/>
 | 
				
			||||||
 | 
					        <label name="prospect_business_unit"/>
 | 
				
			||||||
 | 
					        <field name="prospect_business_unit"/>
 | 
				
			||||||
        <label name="prospect_contact"/>
 | 
					        <label name="prospect_contact"/>
 | 
				
			||||||
        <field name="prospect_contact"/>
 | 
					        <field name="prospect_contact"/>
 | 
				
			||||||
        <label name="prospect_city"/>
 | 
					        <label name="prospect_city"/>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,7 @@
 | 
				
			|||||||
this repository contains the full copyright notices and license terms. -->
 | 
					this repository contains the full copyright notices and license terms. -->
 | 
				
			||||||
<tree>
 | 
					<tree>
 | 
				
			||||||
    <field name="prospect" expand="1"/>
 | 
					    <field name="prospect" expand="1"/>
 | 
				
			||||||
 | 
					    <field name="prospect_business_unit" expand="1"/>
 | 
				
			||||||
    <field name="prospect_contact" expand="1"/>
 | 
					    <field name="prospect_contact" expand="1"/>
 | 
				
			||||||
    <field name="prospect_city" expand="1"/>
 | 
					    <field name="prospect_city" expand="1"/>
 | 
				
			||||||
    <field name="current_interest" expand="1"/>
 | 
					    <field name="current_interest" expand="1"/>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user