bemade-addons/odoo_to_odoo_sync/__init__.py
mathis b792e43873 [IMP] Odoo Sync Modules: Major Enhancements and Fixes
- Added comprehensive README files for all three sync modules
- Implemented advanced logging system with multiple log levels (DEBUG, INFO, WARNING, ERROR)
- Added automatic sensitive data masking for security in log payloads
- Implemented log retention policy (90 days local, 7 years in AWS S3 Glacier)
- Added AWS S3 integration for long-term log archiving
- Fixed validation error with bemade_instance_id in sync model creation
- Refactored model inheritance structure from _inherit to _inherits for proper delegation
- Fixed duplicate sync model prevention logic
- Restored Test Connection button in instance view
- Fixed connection test logging to properly record success/failure
- Fixed queue creation for connection test logs
- Removed unnecessary Synchronized Module tab from odoo_to_odoo_bemade
- Added database indexing on create_date for performance optimization
- Fixed foreign key constraint violations in field mappings creation
- Enhanced error handling throughout the synchronization process
2025-08-15 08:40:17 -04:00

23 lines
766 B
Python

from . import models
from . import utils
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()