feat: se hace por defecto el tipo mobile en contact_type, closed #30
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:
parent
29a20afbfa
commit
0be22b3298
@ -30,12 +30,11 @@ class ContactMethod(ModelSQL, ModelView):
|
||||
'Mecanismo de contacto'
|
||||
__name__ = 'prospect.contact_method'
|
||||
|
||||
_type = [
|
||||
contact_type = fields.Selection([
|
||||
('phone', 'Phone'),
|
||||
('mobile', 'Mobile'),
|
||||
('mail', 'Mail')
|
||||
]
|
||||
contact_type = fields.Selection(_type, 'Contact type', required=True)
|
||||
], 'Contact type', required=True)
|
||||
|
||||
value = fields.Char('Value', required=True)
|
||||
name = fields.Char('Name')
|
||||
@ -43,6 +42,10 @@ class ContactMethod(ModelSQL, ModelView):
|
||||
|
||||
prospect = fields.Many2One('sale.prospect', 'Prospect', required=True)
|
||||
|
||||
@classmethod
|
||||
def default_contact_type(cls):
|
||||
return 'mobile'
|
||||
|
||||
def get_rec_name(self, name):
|
||||
fields = [self.name, self.job, self.value]
|
||||
contact_rec_name = ''
|
||||
|
@ -45,7 +45,7 @@ Crear prospecto::
|
||||
>>> prospect = Prospect()
|
||||
|
||||
>>> prospect.name = 'guchito S.A.S'
|
||||
>>> contact_method = prospect.contact_methods.new(contact_type='mobile', value='31223425234', name='Roberto', job='Gerente R.H')
|
||||
>>> contact_method = prospect.contact_methods.new(value='31223425234', name='Roberto', job='Gerente R.H')
|
||||
>>> contact_method = prospect.contact_methods.new(contact_type='mobile', value='12345678910', name='Pancracia', job='Asistente administrativo')
|
||||
>>> contact_method = prospect.contact_methods.new(contact_type='mail', value='peralto@guchitos.org', name='Peralto', job='Administrador')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user