bemade-addons/odoo_to_odoo_sync/__init__.py
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

24 lines
788 B
Python

from . import models
from . import utils
from . import wizards
import logging
_logger = logging.getLogger(__name__)
# Apply patching on module import
from .models.sync_observer import patch_models
_logger.info("Applying sync observer patches on module import")
patch_models()
def post_init_hook(env=None, registry=None):
"""Post-initialization hook.
This function is called after the module is installed to initialize
the model patching for synchronization.
In Odoo 17/18, this function is called with (env), while in earlier versions
it's called with (cr, registry). We handle both cases for compatibility.
"""
_logger.info("Applying sync observer patches in post_init_hook")
from .models.sync_observer import patch_models
patch_models()