|
@@ -37,23 +37,10 @@ class WhatsAppMessage(models.Model):
|
|
|
if marketing_trace.activity_id.x_studio_grupo_whatsapp:
|
|
if marketing_trace.activity_id.x_studio_grupo_whatsapp:
|
|
|
group = marketing_trace.activity_id.x_studio_grupo_whatsapp.x_studio_destinatario
|
|
group = marketing_trace.activity_id.x_studio_grupo_whatsapp.x_studio_destinatario
|
|
|
|
|
|
|
|
- if not group and False:
|
|
|
|
|
|
|
+ if not group:
|
|
|
notificaciones = self.env['x_notificaciones_whats'].sudo().search([('x_studio_plantilla_de_whatsapp', '=', whatsapp_message.wa_template_id.id)])
|
|
notificaciones = self.env['x_notificaciones_whats'].sudo().search([('x_studio_plantilla_de_whatsapp', '=', whatsapp_message.wa_template_id.id)])
|
|
|
if notificaciones:
|
|
if notificaciones:
|
|
|
_logger.info('template encontrado')
|
|
_logger.info('template encontrado')
|
|
|
-
|
|
|
|
|
- phone_field = whatsapp_message.wa_template_id.phone_field
|
|
|
|
|
- _logger.info(phone_field)
|
|
|
|
|
- phone_field = (phone_field.rpartition('.')[0] + '.id') if '.' in phone_field else phone_field
|
|
|
|
|
- _logger.info(phone_field)
|
|
|
|
|
- partners_ids = record._find_value_from_field_path(phone_field)
|
|
|
|
|
- if partners_ids:
|
|
|
|
|
- partners_ids = list(map(int, partners_ids.split()))
|
|
|
|
|
- for notificacion in notificaciones:
|
|
|
|
|
- if notificacion.x_studio_partner_unico.id in partners_ids:
|
|
|
|
|
- _logger.info('destinatario:' + notificacion.x_studio_destinatario)
|
|
|
|
|
- group = notificacion.x_studio_destinatario
|
|
|
|
|
- break
|
|
|
|
|
if not group:
|
|
if not group:
|
|
|
for notificacion in notificaciones:
|
|
for notificacion in notificaciones:
|
|
|
if not notificacion.x_studio_partner_unico:
|
|
if not notificacion.x_studio_partner_unico:
|