132 lines
9.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_view_form_social" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.social</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="70"/>
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//form" position="inside">
<app data-string="Social Commerce" string="Social Commerce" name="dine360_meta_social">
<field name="meta_connection_status" invisible="1"/>
<field name="whatsapp_connection_status" invisible="1"/>
<field name="whatsapp_webhook_verified" invisible="1"/>
<block title="Meta / Facebook Commerce &amp; Instagram Shopping" id="meta_commerce_settings">
<setting id="meta_credentials_setting" help="Configure credentials to synchronize products to Meta Catalog and Instagram Shopping.">
<field name="meta_sync_enabled"/>
<div class="content-group mt16" invisible="not meta_sync_enabled">
<div class="row mt8">
<label for="meta_catalog_id" class="col-lg-3 o_light_label"/>
<field name="meta_catalog_id" placeholder="e.g. 123456789012345"/>
</div>
<div class="row mt8">
<label for="meta_app_id" class="col-lg-3 o_light_label"/>
<field name="meta_app_id" placeholder="Meta App ID"/>
</div>
<div class="row mt8">
<label for="meta_app_secret" class="col-lg-3 o_light_label"/>
<field name="meta_app_secret" password="True" placeholder="App Secret for Webhook Verification"/>
</div>
<div class="row mt8">
<label for="meta_access_token" class="col-lg-3 o_light_label"/>
<field name="meta_access_token" password="True" placeholder="System User or Commerce Access Token"/>
</div>
<div class="row mt8">
<label for="meta_business_account_id" class="col-lg-3 o_light_label"/>
<field name="meta_business_account_id" placeholder="Meta Business Manager ID"/>
</div>
<div class="row mt8">
<label for="meta_facebook_page_id" class="col-lg-3 o_light_label"/>
<field name="meta_facebook_page_id" placeholder="Facebook Page ID (optional)"/>
</div>
<div class="row mt8">
<label for="meta_instagram_account_id" class="col-lg-3 o_light_label"/>
<field name="meta_instagram_account_id" placeholder="Instagram Business ID (optional)"/>
</div>
<div class="row mt8">
<label for="meta_auto_sync_on_write" class="col-lg-3 o_light_label"/>
<field name="meta_auto_sync_on_write"/>
</div>
<div class="row mt16">
<div class="col-lg-12">
<button name="action_test_meta_connection" string="Test Meta Connection" type="object" class="btn btn-primary me-2" icon="fa-plug"/>
<button name="action_sync_all_meta_products" string="Sync All Published Products Now" type="object" class="btn btn-secondary" icon="fa-refresh"/>
</div>
</div>
<div class="row mt8">
<div class="col-lg-12">
<span class="badge rounded-pill bg-success" invisible="meta_connection_status != 'connected'">Meta Connected</span>
<span class="badge rounded-pill bg-danger" invisible="meta_connection_status != 'error'">Connection Error</span>
<p class="text-danger mt4 small" invisible="not meta_last_test_error"><field name="meta_last_test_error"/></p>
</div>
</div>
</div>
</setting>
</block>
<block title="WhatsApp Business Platform (Cloud API)" id="whatsapp_cloud_settings">
<setting id="whatsapp_credentials_setting" help="Configure WhatsApp Cloud API credentials to enable customer messaging and automated order notifications.">
<field name="whatsapp_enabled"/>
<div class="content-group mt16" invisible="not whatsapp_enabled">
<div class="row mt8">
<label for="whatsapp_phone_number_id" class="col-lg-3 o_light_label"/>
<field name="whatsapp_phone_number_id" placeholder="Phone Number ID from Meta Dashboard"/>
</div>
<div class="row mt8">
<label for="whatsapp_business_account_id" class="col-lg-3 o_light_label"/>
<field name="whatsapp_business_account_id" placeholder="WABA ID"/>
</div>
<div class="row mt8">
<label for="whatsapp_access_token" class="col-lg-3 o_light_label"/>
<field name="whatsapp_access_token" password="True" placeholder="Permanent System User Access Token"/>
</div>
<div class="row mt8">
<label for="whatsapp_verify_token" class="col-lg-3 o_light_label"/>
<field name="whatsapp_verify_token" placeholder="Custom verification token for webhook"/>
</div>
<div class="row mt8">
<label for="whatsapp_webhook_url" class="col-lg-3 o_light_label"/>
<field name="whatsapp_webhook_url" readonly="1" class="text-muted"/>
</div>
<div class="row mt8">
<label for="whatsapp_business_phone_number" class="col-lg-3 o_light_label"/>
<field name="whatsapp_business_phone_number" placeholder="e.g. 15551234567 (no + or spaces)"/>
</div>
<div class="row mt8">
<label for="whatsapp_prefilled_message" class="col-lg-3 o_light_label"/>
<field name="whatsapp_prefilled_message"/>
</div>
<div class="row mt8">
<div class="col-lg-12">
<div class="form-check form-check-inline">
<field name="whatsapp_button_product_page" class="form-check-input"/>
<label for="whatsapp_button_product_page" class="form-check-label">Show WhatsApp Button on Product Page</label>
</div>
<div class="form-check form-check-inline">
<field name="whatsapp_button_floating" class="form-check-input"/>
<label for="whatsapp_button_floating" class="form-check-label">Show Floating WhatsApp Button</label>
</div>
</div>
</div>
<div class="row mt16">
<div class="col-lg-12">
<button name="action_test_whatsapp_connection" string="Test WhatsApp Connection" type="object" class="btn btn-primary" icon="fa-whatsapp"/>
</div>
</div>
<div class="row mt8">
<div class="col-lg-12">
<span class="badge rounded-pill bg-success" invisible="whatsapp_connection_status != 'connected'">WhatsApp API Connected</span>
<span class="badge rounded-pill bg-danger" invisible="whatsapp_connection_status != 'error'">Connection Error</span>
<span class="badge rounded-pill bg-info ms-2" invisible="not whatsapp_webhook_verified">Webhook Verified</span>
<p class="text-danger mt4 small" invisible="not whatsapp_last_test_error"><field name="whatsapp_last_test_error"/></p>
</div>
</div>
</div>
</setting>
</block>
</app>
</xpath>
</field>
</record>
</odoo>