bemade-addons/odoo_to_odoo_bemade_customer/__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

23 lines
833 B
Python

from . import models
from odoo import api, SUPERUSER_ID
def post_init_hook(env):
"""Post-install hook to set up customer-specific configuration."""
# Set default configuration parameters for customer instances
ICP = env['ir.config_parameter']
# Ensure the parameters exist with default values
defaults = {
'customer.sync.default_url': 'https://odoo.bemade.org',
'customer.sync.default_database': 'bemade',
'customer.sync.default_username': 'customer_sync',
'customer.sync.default_connection_type': 'odoorpc',
'bemade.sync.default_timeout': '30',
'bemade.sync.default_retry_count': '3',
'bemade.sync.default_retry_delay': '5',
}
for key, value in defaults.items():
if not ICP.get_param(key):
ICP.set_param(key, value)