64 lines
3.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Product Template Form View Extension -->
<record id="product_template_form_view_social" model="ir.ui.view">
<field name="name">product.template.form.social</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<button name="action_sync_to_meta" string="Sync to Meta Catalog" type="object" class="btn btn-secondary"
groups="dine360_meta_social.group_social_user" icon="fa-facebook"/>
</xpath>
<xpath expr="//page[@name='sales']" position="after">
<page string="Meta / Instagram Catalog" name="meta_social_catalog" groups="dine360_meta_social.group_social_user">
<group>
<group string="Catalog Sync Settings">
<field name="meta_sync_enabled"/>
<field name="meta_sync_status" widget="badge"
decoration-success="meta_sync_status == 'synced'"
decoration-warning="meta_sync_status == 'pending'"
decoration-danger="meta_sync_status == 'failed'"/>
</group>
<group string="Sync Audit Details">
<field name="meta_last_sync"/>
<field name="meta_sync_error" invisible="not meta_sync_error" class="text-danger"/>
</group>
</group>
</page>
</xpath>
</field>
</record>
<!-- Product Template Tree View Extension -->
<record id="product_template_tree_view_social" model="ir.ui.view">
<field name="name">product.template.tree.social</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_tree_view"/>
<field name="arch" type="xml">
<field name="name" position="after">
<field name="meta_sync_status" widget="badge" optional="show"
decoration-success="meta_sync_status == 'synced'"
decoration-warning="meta_sync_status == 'pending'"
decoration-danger="meta_sync_status == 'failed'"/>
</field>
</field>
</record>
<!-- Product Variant Form View Extension -->
<record id="product_product_form_view_social" model="ir.ui.view">
<field name="name">product.product.form.social</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<button name="action_sync_to_meta" string="Sync to Meta" type="object" class="btn btn-secondary"
groups="dine360_meta_social.group_social_user" icon="fa-facebook"/>
</xpath>
<xpath expr="//field[@name='barcode']" position="after">
<field name="meta_product_id" readonly="1"/>
</xpath>
</field>
</record>
</odoo>