| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?xml version="1.0" encoding="utf-8"?>
- <odoo>
- <data>
- <!-- Extender vista de formulario del composer de WhatsApp -->
- <record id="whatsapp_composer_view_form_groups" model="ir.ui.view">
- <field name="name">whatsapp.composer.view.form.groups</field>
- <field name="model">whatsapp.composer</field>
- <field name="inherit_id" ref="whatsapp.whatsapp_composer_view_form"/>
- <field name="arch" type="xml">
- <!-- Agregar opción de envío a grupos -->
- <xpath expr="//field[@name='phone']" position="before">
- <group string="Recipient Configuration" name="recipient_config">
- <field name="recipient_type" widget="radio" options="{'horizontal': true}"/>
- </group>
- </xpath>
-
- <!-- Hacer wa_template_id opcional para WhatsApp Web -->
- <xpath expr="//field[@name='wa_template_id']" position="attributes">
- <attribute name="help">Template required for WhatsApp Business API. Optional for WhatsApp Web accounts.</attribute>
- </xpath>
-
- <!-- Modificar campo phone para que sea condicional -->
- <xpath expr="//field[@name='phone']" position="attributes">
- <attribute name="invisible">recipient_type == 'group'</attribute>
- <attribute name="required">False</attribute>
- </xpath>
-
- <!-- Agregar campos de grupo después del teléfono -->
- <!-- Nota: El campo whatsapp_group_id Many2one está en whatsapp_web_groups -->
- <xpath expr="//field[@name='phone']" position="after">
- <field name="whatsapp_group_id_char"
- invisible="recipient_type != 'group'"
- placeholder="Enter Group ID manually (e.g., 120363158956331133@g.us)"
- string="Group ID"/>
- </xpath>
-
- <!-- Agregar campo de mensaje libre para WhatsApp Web -->
- <xpath expr="//field[@name='wa_template_id']" position="after">
- <field name="body"
- invisible="wa_template_id"
- placeholder="Write your free text message here (only for WhatsApp Web accounts)..."
- string="Free Text Message"/>
- </xpath>
- </field>
- </record>
- </data>
- </odoo>
|