bemade-addons/odoo_to_odoo_bemade/views/api_key_views.xml
mathis 4d92c5a72f [IMP] odoo_to_odoo_sync: implement dependency management, fix connection errors, and add field mapping
- Added comprehensive dependency management with proper OdooRPC library integration
- Fixed XML-RPC, JSON-RPC, and OdooRPC connection authentication issues
- Implemented proper Odoo 18 API key format support with scope parameter
- Added intelligent field mapping wizard with Full/Required/Balanced modes
- Enhanced error handling and connection state management
- Removed legacy API key system for clean reinstall capability
- Added detailed debug logging for connection troubleshooting
2025-08-15 08:40:48 -04:00

142 lines
6.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- API Key Tree View -->
<record id="view_api_key_tree" model="ir.ui.view">
<field name="name">odoo.to.bemade.api.key.tree</field>
<field name="model">odoo.to.bemade.api.key</field>
<field name="arch" type="xml">
<tree decoration-muted="not is_active" decoration-danger="expiration_date and expiration_date &lt; current_date">
<field name="name"/>
<field name="user_id"/>
<field name="create_date"/>
<field name="last_used"/>
<field name="expiration_date"/>
<field name="usage_count"/>
<field name="is_active" widget="boolean_toggle"/>
</tree>
</field>
</record>
<!-- API Key Form View -->
<record id="view_api_key_form" model="ir.ui.view">
<field name="name">odoo.to.bemade.api.key.form</field>
<field name="model">odoo.to.bemade.api.key</field>
<field name="arch" type="xml">
<form>
<header>
<button name="action_generate_key" string="Generate API Key"
type="object" class="btn-primary">
<attribute name="invisible">key_hash</attribute>
</button>
<button name="action_revoke" string="Revoke API Key"
type="object" class="btn-danger">
<attribute name="invisible">not is_active</attribute>
</button>
<button name="action_activate" string="Activate API Key"
type="object" class="btn-success">
<attribute name="invisible">is_active</attribute>
</button>
</header>
<sheet>
<div class="oe_title">
<h1>
<field name="name" placeholder="API Key Name"/>
</h1>
</div>
<group>
<group>
<field name="user_id"/>
<field name="create_date"/>
<field name="last_used"/>
<field name="usage_count"/>
</group>
<group>
<field name="expiration_date"/>
<field name="is_active"/>
<field name="key_hash" invisible="1"/>
</group>
</group>
<notebook>
<page string="Notes">
<field name="notes" placeholder="Add notes about this API key..."/>
</page>
<page string="Used In Instances">
<attribute name="invisible">not instance_ids</attribute>
<field name="instance_ids" readonly="1">
<tree>
<field name="name"/>
<field name="url"/>
<field name="state"/>
<field name="last_connection"/>
</tree>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<!-- API Key Search View -->
<record id="view_api_key_search" model="ir.ui.view">
<field name="name">odoo.to.bemade.api.key.search</field>
<field name="model">odoo.to.bemade.api.key</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<field name="user_id"/>
<filter string="Active" name="active" domain="[('is_active', '=', True)]"/>
<filter string="Inactive" name="inactive" domain="[('is_active', '=', False)]"/>
<filter string="Expired" name="expired" domain="[('expiration_date', '&lt;', context_today())]"/>
<filter string="Never Used" name="never_used" domain="[('last_used', '=', False)]"/>
<group expand="0" string="Group By">
<filter string="Created By" name="group_by_user" context="{'group_by': 'user_id'}"/>
<filter string="Creation Month" name="group_by_month" context="{'group_by': 'create_date:month'}"/>
</group>
</search>
</field>
</record>
<!-- API Key Display Wizard Form View -->
<record id="view_api_key_display_form" model="ir.ui.view">
<field name="name">odoo.to.bemade.api.key.display.form</field>
<field name="model">odoo.to.bemade.api.key.display</field>
<field name="arch" type="xml">
<form>
<sheet>
<field name="warning_message" widget="html"/>
<group>
<field name="api_key_id" invisible="1"/>
<field name="api_key" widget="CopyClipboardChar"/>
</group>
</sheet>
<footer>
<button string="Close" class="btn-primary" special="cancel"/>
</footer>
</form>
</field>
</record>
<!-- API Key Action -->
<record id="action_api_key" model="ir.actions.act_window">
<field name="name">API Keys</field>
<field name="res_model">odoo.to.bemade.api.key</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_active': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No API keys found
</p>
<p>
Create a new API key for authenticating remote Odoo instances.
</p>
</field>
</record>
<!-- API Key Menu -->
<menuitem id="menu_api_key"
name="API Keys"
parent="odoo_to_odoo_sync.menu_sync_config"
action="action_api_key"
sequence="30"/>
</odoo>