Commit 51a9086d by juan

Correcciones de usabilidad

1 parent d7c4d2d4
# -*- coding: utf-8 -*-
from . import instituciones
from . import contactos
\ No newline at end of file
#from . import instituciones
#from . import contactos
\ No newline at end of file
......@@ -9,10 +9,12 @@ class hgt_llamada_pendiente(models.TransientModel):
string=u'Organización',
comodel_name='hgt.instituciones',
ondelete='restrict',
default=lambda self: self.ong()
)
fecha_llamada = fields.Datetime(
string='Fecha y hora de la llamada',
default=fields.Date.context_today,
)
fecha_hoy = fields.Date(
......@@ -22,7 +24,8 @@ class hgt_llamada_pendiente(models.TransientModel):
medio = fields.Selection(
string=u'Medio',
selection=[('Telefono', 'Teléfono'), ('Whatsapp', 'Whatsapp'), ('E-Mail', 'E-Mail'),]
selection=[('Telefono', 'Teléfono'), ('Whatsapp', 'Whatsapp'), ('E-Mail', 'E-Mail'),],
default='Telefono'
)
notas = fields.Text(
......@@ -65,6 +68,13 @@ class hgt_llamada_pendiente(models.TransientModel):
temas = fields.Html(
string='Temas a tratar',
)
def ong(self):
ids = self.env.context.get('active_ids', [])
try:
return(ids[0])
except:
return(False)
@api.onchange('organizacion')
def dominio_personas(self):
......@@ -81,10 +91,17 @@ class hgt_llamada_pendiente(models.TransientModel):
result['domain'] = []
person = self.persona
ids = self.persona.contactos.ids
#print(ids)
default = self.env["asw.contactos"].search([('id', 'in', ids)])
#print(default)
if not len(default) == 0:
self.contacto = default[0]
result['domain'] = {'contacto' : [('id', 'in', ids)]}
return result
def crear_tarea(self):
#import ipdb; ipdb.set_trace()
if self.otro:
#creo el contacto
vals = {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!