Initial commit
This commit is contained in:
179
fusion_inventory_sync/views/sync_config_views.xml
Normal file
179
fusion_inventory_sync/views/sync_config_views.xml
Normal file
@@ -0,0 +1,179 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<!-- Sync Config Form View -->
|
||||
<record id="view_fusion_sync_config_form" model="ir.ui.view">
|
||||
<field name="name">fusion.sync.config.form</field>
|
||||
<field name="model">fusion.sync.config</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<header>
|
||||
<button name="action_test_connection" type="object"
|
||||
string="Test Connection" class="btn-primary"
|
||||
invisible="state == 'connected'"/>
|
||||
<button name="action_test_connection" type="object"
|
||||
string="Re-Test Connection"
|
||||
invisible="state != 'connected'"/>
|
||||
<button name="action_sync_now" type="object"
|
||||
string="Sync Now" class="btn-primary"
|
||||
invisible="state != 'connected'"/>
|
||||
<field name="state" widget="statusbar"
|
||||
statusbar_visible="draft,connected"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<h1><field name="name" placeholder="e.g., Mobility Specialties"/></h1>
|
||||
</div>
|
||||
<group>
|
||||
<group string="Connection">
|
||||
<field name="url" placeholder="https://erp.mobilityspecialties.com"/>
|
||||
<field name="db_name" placeholder="mobility-prod"/>
|
||||
<field name="username" placeholder="admin"/>
|
||||
<field name="api_key" password="True"/>
|
||||
</group>
|
||||
<group string="Sync Settings">
|
||||
<field name="sync_products"/>
|
||||
<field name="sync_stock"/>
|
||||
<field name="sync_interval"/>
|
||||
<field name="remote_warehouse_name"
|
||||
placeholder="Leave empty for all warehouses"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="Status">
|
||||
<field name="last_sync"/>
|
||||
<field name="last_sync_status"/>
|
||||
<field name="remote_uid" invisible="state != 'connected'"/>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="Product Mappings" name="mappings">
|
||||
<field name="active" invisible="1"/>
|
||||
<p class="text-muted" invisible="state == 'connected'">
|
||||
Connect and sync to see product mappings here.
|
||||
</p>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Sync Config List View -->
|
||||
<record id="view_fusion_sync_config_list" model="ir.ui.view">
|
||||
<field name="name">fusion.sync.config.list</field>
|
||||
<field name="model">fusion.sync.config</field>
|
||||
<field name="arch" type="xml">
|
||||
<list>
|
||||
<field name="name"/>
|
||||
<field name="url"/>
|
||||
<field name="state" widget="badge"
|
||||
decoration-success="state == 'connected'"
|
||||
decoration-danger="state == 'error'"
|
||||
decoration-info="state == 'draft'"/>
|
||||
<field name="last_sync"/>
|
||||
<field name="last_sync_status"/>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Product Mapping List View -->
|
||||
<record id="view_fusion_product_sync_mapping_list" model="ir.ui.view">
|
||||
<field name="name">fusion.product.sync.mapping.list</field>
|
||||
<field name="model">fusion.product.sync.mapping</field>
|
||||
<field name="arch" type="xml">
|
||||
<list editable="bottom">
|
||||
<field name="remote_product_name"/>
|
||||
<field name="remote_default_code"/>
|
||||
<field name="local_product_id"/>
|
||||
<field name="auto_matched" widget="boolean"/>
|
||||
<field name="remote_qty_available"
|
||||
decoration-danger="remote_qty_available == 0"
|
||||
decoration-success="remote_qty_available > 0"/>
|
||||
<field name="remote_qty_forecast"/>
|
||||
<field name="last_stock_sync"/>
|
||||
<field name="config_id" column_invisible="1"/>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Product Mapping Search View -->
|
||||
<record id="view_fusion_product_sync_mapping_search" model="ir.ui.view">
|
||||
<field name="name">fusion.product.sync.mapping.search</field>
|
||||
<field name="model">fusion.product.sync.mapping</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="remote_product_name"/>
|
||||
<field name="remote_default_code"/>
|
||||
<field name="local_product_id"/>
|
||||
<separator/>
|
||||
<filter name="mapped" string="Mapped"
|
||||
domain="[('local_product_id', '!=', False)]"/>
|
||||
<filter name="unmapped" string="Unmapped"
|
||||
domain="[('local_product_id', '=', False)]"/>
|
||||
<filter name="in_stock" string="Remote In Stock"
|
||||
domain="[('remote_qty_available', '>', 0)]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Menu Items -->
|
||||
<menuitem id="menu_fusion_sync_root"
|
||||
name="Inventory Sync"
|
||||
parent="stock.menu_stock_config_settings"
|
||||
sequence="100"/>
|
||||
|
||||
<record id="action_fusion_sync_config" model="ir.actions.act_window">
|
||||
<field name="name">Sync Configurations</field>
|
||||
<field name="res_model">fusion.sync.config</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
</record>
|
||||
<menuitem id="menu_fusion_sync_config"
|
||||
name="Remote Connections"
|
||||
parent="menu_fusion_sync_root"
|
||||
action="action_fusion_sync_config"
|
||||
sequence="10"/>
|
||||
|
||||
<record id="action_fusion_product_mapping" model="ir.actions.act_window">
|
||||
<field name="name">Product Mappings</field>
|
||||
<field name="res_model">fusion.product.sync.mapping</field>
|
||||
<field name="view_mode">list</field>
|
||||
<field name="context">{'search_default_mapped': 1}</field>
|
||||
</record>
|
||||
<menuitem id="menu_fusion_product_mapping"
|
||||
name="Product Mappings"
|
||||
parent="menu_fusion_sync_root"
|
||||
action="action_fusion_product_mapping"
|
||||
sequence="20"/>
|
||||
|
||||
<!-- Sync Log List View -->
|
||||
<record id="view_fusion_sync_log_list" model="ir.ui.view">
|
||||
<field name="name">fusion.sync.log.list</field>
|
||||
<field name="model">fusion.sync.log</field>
|
||||
<field name="arch" type="xml">
|
||||
<list>
|
||||
<field name="create_date" string="Date"/>
|
||||
<field name="config_id"/>
|
||||
<field name="direction"/>
|
||||
<field name="sync_type"/>
|
||||
<field name="status" widget="badge"
|
||||
decoration-success="status == 'success'"
|
||||
decoration-warning="status == 'partial'"
|
||||
decoration-danger="status == 'error'"/>
|
||||
<field name="summary"/>
|
||||
<field name="product_count"/>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_fusion_sync_log" model="ir.actions.act_window">
|
||||
<field name="name">Sync Log</field>
|
||||
<field name="res_model">fusion.sync.log</field>
|
||||
<field name="view_mode">list</field>
|
||||
</record>
|
||||
<menuitem id="menu_fusion_sync_log"
|
||||
name="Sync Log"
|
||||
parent="menu_fusion_sync_root"
|
||||
action="action_fusion_sync_log"
|
||||
sequence="30"/>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user