feat(odoo): add menu and account views

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Claude AI
2026-01-29 22:45:33 +00:00
parent 5f61a815e5
commit ad218ecccf
2 changed files with 107 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<!-- Tree View -->
<record id="view_whatsapp_account_tree" model="ir.ui.view">
<field name="name">whatsapp.account.tree</field>
<field name="model">whatsapp.account</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="phone_number"/>
<field name="status" widget="badge" decoration-success="status == 'connected'" decoration-warning="status == 'connecting'" decoration-danger="status == 'disconnected'"/>
<field name="is_default"/>
<field name="conversation_count"/>
</tree>
</field>
</record>
<!-- Form View -->
<record id="view_whatsapp_account_form" model="ir.ui.view">
<field name="name">whatsapp.account.form</field>
<field name="model">whatsapp.account</field>
<field name="arch" type="xml">
<form>
<header>
<button name="action_sync_status" string="Actualizar Estado" type="object" class="btn-primary"/>
<field name="status" widget="statusbar" statusbar_visible="disconnected,connecting,connected"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="action_view_conversations" type="object" class="oe_stat_button" icon="fa-comments">
<field name="conversation_count" widget="statinfo" string="Conversaciones"/>
</button>
</div>
<group>
<group>
<field name="name"/>
<field name="phone_number"/>
<field name="external_id"/>
<field name="is_default"/>
</group>
<group>
<field name="api_url"/>
<field name="api_key" password="True"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
</group>
<notebook>
<page string="Código QR" name="qr_code" invisible="status != 'connecting'">
<field name="qr_code" widget="image" class="oe_avatar"/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<!-- Action -->
<record id="action_whatsapp_account" model="ir.actions.act_window">
<field name="name">Cuentas WhatsApp</field>
<field name="res_model">whatsapp.account</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>