bemade-addons/odoo_to_odoo_bemade/views/sync_instance_views.xml

134 lines
6.5 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Vue formulaire pour les instances de synchronisation -->
<record id="view_odoo_to_bemade_instance_form" model="ir.ui.view">
<field name="name">odoo.to.bemade.instance.form</field>
<field name="model">odoo.to.bemade.instance</field>
<field name="arch" type="xml">
<form string="Instance Bemade">
<header>
<button name="test_connection" string="Tester la connexion" type="object" class="oe_highlight"/>
<field name="state" widget="statusbar"
statusbar_visible="draft,testing,error,connected"/>
</header>
<sheet>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name" placeholder="Nom de l'instance"/></h1>
</div>
<group>
<group>
<field name="url" placeholder="https://exemple.bemade.org">
<attribute name="readonly">state == 'connected'</attribute>
</field>
<field name="database">
<attribute name="readonly">state == 'connected'</attribute>
</field>
</group>
<group>
<field name="username">
<attribute name="readonly">state == 'connected'</attribute>
</field>
<field name="use_api_key" widget="boolean_toggle"/>
<field name="password" password="True">
<attribute name="readonly">state == 'connected'</attribute>
<attribute name="invisible">use_api_key</attribute>
</field>
feat: Complete bidirectional sync system with legacy cleanup BREAKING CHANGE: Legacy API key system (sync.api.key) completely removed Major Features: - Complete bidirectional synchronization system between Odoo instances - Legacy API key system removal and migration to built-in Odoo API keys - Full protocol support: XML-RPC, JSON-RPC, and OdooRPC with API token authentication - Bidirectional project sync with assign/receive wizard system - Auto-sync wizard for intelligent field selection - Comprehensive test suite for sync workflows Detailed Changes: odoo_to_odoo_sync (base module): - Removed legacy sync.api.key and sync.api.key.log models entirely - Added sync_project and sync_project_config_wizard models - Enhanced sync_instance with proper Odoo 18 API key format support - Added protocol selection (XML-RPC, JSON-RPC, OdooRPC) with API token auth - Implemented comprehensive authentication with debug logging - Added test_sync_workflow.py for complete workflow testing - Updated security access rules for new models - Enhanced error handling and state management odoo_to_odoo_bemade (server module): - Created OdooToBemadeInstance model for enhanced instance management - Added assign project wizard for server-side project distribution - Implemented project key and API token generation system - Added automatic sync model creation for projects and tasks - Enhanced sync_instance with bidirectional sync capabilities - Updated views and security access for new functionality - Removed legacy API key references and views odoo_to_odoo_bemade_customer (client module): - Added project model with Bemade sync flags (is_bemade_project, bemade_project_key) - Created receive project wizard for client-side project acquisition - Implemented multi-protocol support (XML-RPC, JSON-RPC, OdooRPC) - Added project sync validation and configuration system - Enhanced security access rules for client operations - Updated views for project management interface Authentication & Protocol Support: - Fixed Odoo 18 API key format: {'scope': 'rpc', 'key': api_token} - Added comprehensive debug logging for authentication flow - Enhanced error handling with detailed state management - Maintained backward compatibility with fallback attempts - Updated all protocol implementations (XML-RPC, JSON-RPC, OdooRPC) Testing & Validation: - Added complete test suite for bidirectional sync workflow - Implemented comprehensive authentication testing - Added protocol-specific test cases - Enhanced error state validation UI/UX Improvements: - Added intuitive wizards for project assign/receive operations - Implemented auto-sync wizard with field selection modes (Full, Required, Balanced) - Enhanced form views with radio button selections - Added descriptive text and user guidance Security: - Updated security access rules for all new models - Enhanced authentication token handling - Added proper model access controls Migration Notes: - Legacy API key system completely removed - no migration path needed - Uses built-in Odoo API key functionality - All existing configurations remain compatible Files Added/Modified: - Multiple new model files for project sync functionality - Wizard implementations for user workflows - Enhanced test coverage - Updated security rules and access controls - New view definitions for UI components
2025-08-17 08:20:24 -04:00
<field name="api_key" password="True">
<attribute name="invisible">not use_api_key</attribute>
<attribute name="required">use_api_key</attribute>
</field>
</group>
</group>
<group>
<field name="connection_type" widget="radio"/>
<field name="active"/>
</group>
<notebook>
<page string="Modèles synchronisés">
<field name="model_ids" mode="list">
<list>
<field name="name"/>
<field name="model_id"/>
<field name="target_model"/>
<field name="active"/>
</list>
</field>
</page>
<page string="Options avancées">
<group>
<field name="connection_timeout"/>
<field name="retry_count"/>
<field name="retry_delay"/>
</group>
</page>
<page string="Journal de connexion">
<field name="log_ids" mode="list">
<list>
<field name="create_date"/>
<field name="name"/>
<field name="state"/>
</list>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<!-- Vue liste pour les instances de synchronisation -->
<record id="view_odoo_to_bemade_instance_tree" model="ir.ui.view">
<field name="name">odoo.to.bemade.instance.tree</field>
<field name="model">odoo.to.bemade.instance</field>
<field name="arch" type="xml">
<list string="Instances Bemade" decoration-success="state == 'connected'" decoration-danger="state == 'error'" decoration-info="state == 'testing'" decoration-muted="state == 'draft'">
<field name="name"/>
<field name="url"/>
<field name="database"/>
<field name="username"/>
<field name="connection_type"/>
<field name="state"/>
<field name="active" invisible="1"/>
</list>
</field>
</record>
<!-- Vue recherche pour les instances de synchronisation -->
<record id="view_odoo_to_bemade_instance_search" model="ir.ui.view">
<field name="name">odoo.to.bemade.instance.search</field>
<field name="model">odoo.to.bemade.instance</field>
<field name="arch" type="xml">
<search string="Rechercher une instance">
<field name="name"/>
<field name="url"/>
<field name="database"/>
<field name="username"/>
<filter string="Actives" name="active" domain="[('active', '=', True)]"/>
<filter string="Connectées" name="connected" domain="[('state', '=', 'connected')]"/>
<filter string="En erreur" name="error" domain="[('state', '=', 'error')]"/>
<group expand="0" string="Regrouper par">
<filter string="État" name="groupby_state" domain="[]" context="{'group_by': 'state'}"/>
<filter string="Type de connexion" name="groupby_connection_type" domain="[]" context="{'group_by': 'connection_type'}"/>
</group>
</search>
</field>
</record>
<!-- Action pour les instances -->
<record id="action_odoo_to_bemade_instances" model="ir.actions.act_window">
<field name="name">Instances Bemade</field>
<field name="res_model">odoo.to.bemade.instance</field>
<field name="view_mode">list,form</field>
<field name="context">{'search_default_active': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Créer votre première instance de connexion à Bemade
</p>
<p>
Une instance représente une connexion à une plateforme Bemade
</p>
</field>
</record>
</odoo>