feat: Major WhatsApp integration update with Odoo and pause/resume

## Frontend
- Add media display (images, audio, video, docs) in Inbox
- Add pause/resume functionality for WhatsApp accounts
- Fix media URLs to use nginx proxy (relative URLs)

## API Gateway
- Add /accounts/:id/pause and /accounts/:id/resume endpoints
- Fix media URL handling for browser access

## WhatsApp Core
- Add pauseSession() - disconnect without logout
- Add resumeSession() - reconnect using saved credentials
- Add media download and storage for incoming messages
- Serve media files via /media/ static route

## Odoo Module (odoo_whatsapp_hub)
- Add Chat Hub interface with DOLLARS theme (dark, 3-column layout)
- Add WhatsApp/DRRR theme switcher for chat view
- Add "ABRIR CHAT" button in conversation form
- Add send_message_from_chat() method
- Add security/ir.model.access.csv
- Fix CSS scoping to avoid breaking Odoo UI
- Update webhook to handle message events properly

## Documentation
- Add docs/CONTEXTO_DESARROLLO.md with complete project context

## Infrastructure
- Add whatsapp_media Docker volume
- Configure nginx proxy for /media/ route
- Update .gitignore to track src/sessions/ source files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Claude AI
2026-01-30 20:48:56 +00:00
parent 1040debe2e
commit 5dd3499097
33 changed files with 3636 additions and 138 deletions

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<!-- Client Action for Dollars Chat Interface -->
<record id="action_dollars_whatsapp_chat" model="ir.actions.client">
<field name="name">WhatsApp Chat</field>
<field name="tag">dollars_whatsapp_chat</field>
<field name="target">fullscreen</field>
</record>
</odoo>

View File

@@ -5,55 +5,46 @@
<field name="name">whatsapp.conversation.tree</field>
<field name="model">whatsapp.conversation</field>
<field name="arch" type="xml">
<list decoration-bf="unread_count > 0">
<list>
<field name="display_name"/>
<field name="phone_number"/>
<field name="status" widget="badge" decoration-info="status == 'bot'" decoration-warning="status == 'waiting'" decoration-success="status == 'active'" decoration-muted="status == 'resolved'"/>
<field name="assigned_user_id" widget="many2one_avatar_user"/>
<field name="status"/>
<field name="last_message_at"/>
<field name="last_message_preview"/>
<field name="unread_count" widget="badge" decoration-danger="unread_count > 0"/>
</list>
</field>
</record>
<!-- Form View -->
<!-- Form View - Simplified -->
<record id="view_whatsapp_conversation_form" model="ir.ui.view">
<field name="name">whatsapp.conversation.form</field>
<field name="model">whatsapp.conversation</field>
<field name="arch" type="xml">
<form>
<header>
<button name="action_assign_to_me" string="Asignarme" type="object" class="btn-primary" invisible="assigned_user_id"/>
<button name="action_mark_resolved" string="Resolver" type="object" class="btn-secondary" invisible="status == 'resolved'"/>
<field name="status" widget="statusbar" statusbar_visible="bot,waiting,active,resolved"/>
<button name="action_open_chat" string="ABRIR CHAT" type="object" class="btn-primary"/>
<button name="action_mark_resolved" string="Resolver" type="object"/>
<field name="status" widget="statusbar"/>
</header>
<sheet>
<group>
<group>
<field name="display_name" readonly="1"/>
<field name="display_name"/>
<field name="phone_number"/>
<field name="partner_id"/>
</group>
<group>
<field name="account_id"/>
<field name="assigned_user_id"/>
<field name="last_message_at"/>
</group>
</group>
<notebook>
<page string="Mensajes" name="messages">
<field name="message_ids" mode="list" readonly="1">
<list>
<field name="create_date"/>
<field name="direction" widget="badge"/>
<field name="content"/>
<field name="status" widget="badge"/>
<field name="sent_by_id"/>
</list>
</field>
</page>
</notebook>
<field name="message_ids">
<list>
<field name="create_date"/>
<field name="direction"/>
<field name="content"/>
<field name="media_url" widget="url"/>
<field name="status"/>
</list>
</field>
</sheet>
</form>
</field>
@@ -66,7 +57,6 @@
<field name="arch" type="xml">
<search>
<field name="phone_number"/>
<field name="partner_id"/>
</search>
</field>
</record>

View File

@@ -8,10 +8,19 @@
sequence="50"
/>
<!-- Conversations Menu -->
<!-- Chat Hub (Dollars Interface) -->
<menuitem
id="menu_whatsapp_chat_hub"
name="Chat Hub"
parent="menu_whatsapp_root"
action="action_dollars_whatsapp_chat"
sequence="5"
/>
<!-- Conversations Menu (classic view) -->
<menuitem
id="menu_whatsapp_conversations"
name="Conversaciones"
name="Conversaciones (Lista)"
parent="menu_whatsapp_root"
action="action_whatsapp_conversation"
sequence="10"