- 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
4.9 KiB
4.9 KiB
Manual Testing Guide: Dependency Management
Overview
This guide provides step-by-step instructions for manually testing the dependency management feature in your Odoo-to-Odoo sync module.
Prerequisites
- Your traefik-test environment is running (both Odoo instances)
- The odoo_to_odoo_sync module is installed and updated
- You have access to both Odoo instances via web browser
Test 1: Basic Dependency Detection
Steps:
-
Access Odoo Instance 1: Open http://localhost:8069
-
Navigate to: Odoo Sync → Configuration → Models
-
Create Test Models:
- Click "Create" to add new sync models
- Create these models in order:
- Model: res.partner
- Model: res.users (depends on res.partner via partner_id field)
- Model: sale.order (depends on res.partner via partner_id field)
- Model: sale.order.line (depends on sale.order via order_id field)
-
Activate Models: Ensure all models are active
-
Update Dependencies:
- Go to Odoo Sync → Configuration → Dependency Resolver
- Click on the resolver record
- Click "Update Model Dependencies"
Expected Results:
- Navigate to Odoo Sync → Configuration → Dependencies
- You should see dependency records created automatically
- Check for relationships like:
- res.users → res.partner (Many2one)
- sale.order → res.partner (Many2one)
- sale.order.line → sale.order (Many2one)
Test 2: Circular Dependency Detection
Steps:
-
Create Circular Dependency:
- Create 3 test models with custom fields:
- Model A: has Many2one to Model B
- Model B: has Many2one to Model C
- Model C: has Many2one to Model A
-
Update Dependencies: Use the dependency resolver
Expected Results:
- Circular dependencies should be detected and logged
- Check Odoo Sync → Logs for circular dependency warnings
- Dependencies should still be created but marked as circular
Test 3: Processing Order Validation
Steps:
-
Create Sync Queue Items:
- Create sync queue items for models with dependencies
- Ensure items are created in "wrong" order (dependent models first)
-
Process Queue:
- Go to Odoo Sync → Queue
- Process the queue items
Expected Results:
- Items should be processed in dependency order
- Check the sync logs to verify processing sequence
- Items with unmet dependencies should be retried later
Test 4: Missing Dependency Handling
Steps:
-
Create Incomplete Setup:
- Create a sync model that depends on another model
- Do NOT create the dependent model
- Create a sync queue item for the incomplete model
-
Process Queue:
- Attempt to process the queue item
Expected Results:
- The item should be marked as failed due to missing dependency
- Retry count should increment
- Error message should mention missing dependency
Test 5: Integration Test
Steps:
-
Full Setup:
- Set up sync between two Odoo instances
- Configure models with dependencies
- Create records in source instance
-
Trigger Sync:
- Create/update records in dependent order
- Check sync results
Expected Results:
- Records sync in correct dependency order
- No foreign key constraint violations
- All records sync successfully
Validation Checklist
Model Dependencies:
- Dependencies are automatically detected
- Dependency records are created correctly
- Circular dependencies are detected and logged
- Processing order respects dependencies
Error Handling:
- Missing dependencies are handled gracefully
- Retry mechanism works for missing dependencies
- Error messages are clear and helpful
Performance:
- Dependency resolution completes quickly
- No performance degradation with many models
- Memory usage remains reasonable
Debug Commands
Check Dependencies:
# In Odoo shell
env['odoo.sync.dependency'].search([]).read(['source_model_id', 'target_model_id', 'relation_type'])
Check Processing Order:
# In Odoo shell
env['odoo.sync.queue'].search([]).sorted('processing_order').read(['model_id', 'state'])
Force Dependency Update:
# In Odoo shell
resolver = env['odoo.sync.dependency.resolver'].search([])[0]
resolver.update_model_dependencies()
Troubleshooting
Common Issues:
- Models not appearing: Check if models are active in sync configuration
- Dependencies not created: Verify models have actual field relationships
- Circular dependencies: Review model relationships for actual cycles
Debug Logs:
- Check Odoo logs for dependency management messages
- Look for entries with "dependency" or "resolver" keywords
- Enable debug logging if needed:
--log-level=debug
Success Criteria
All tests pass when:
- Dependencies are correctly detected and recorded
- Processing order respects dependencies
- Circular dependencies are handled
- Missing dependencies are retried appropriately
- No foreign key violations occur during sync