Breaking Changes Ahead
Migration Guide
Transform your codebase from static v0.3.x to the revolutionary dynamic v0.4.x
FROMv0.3.xStatic
TOv0.4.xDynamic
Overview
Major Architecture Change: v0.4.8 introduces a completely dynamic approach where models and services are generated at runtime from your Acumatica instance's schema. No more static model definitions!
What's Changed?
v0.3.x (Static)
- Pre-defined model classes
- Manual service definitions
- Fixed field sets
- No custom field support
- Manual updates for changes
- Import specific models
v0.4.x (Dynamic)
- Runtime-generated models
- Auto-discovered services
- All fields from schema
- Full custom field support
- Zero maintenance
- Models via client.models.*
Breaking Changes
Step-by-Step Migration
Update Package
First, update to the latest version of easy-acumatica:
pip install --upgrade easy-acumatica>=0.4.8
Common Migration Patterns
CRUD Operations Migration
Creating Records
❌ Old (v0.3.x)
# v0.3.x
from easy_acumatica.models import Contact
contact = Contact()
contact.DisplayName = "John Doe"
contact.Email = "john@example.com"
result = contact_service.create(contact)
✅ New (v0.4.x)
# v0.4.x
# Models via client.models
contact = client.models.Contact(
DisplayName="John Doe",
Email="john@example.com"
)
result = client.contacts.put_entity(contact)
Updating Records
❌ Old (v0.3.x)
# v0.3.x
contact = contact_service.get_by_id("C000123")
contact.Email = "newemail@example.com"
updated = contact_service.update(contact)
✅ New (v0.4.x)
# v0.4.x
# Partial updates supported!
update = client.models.Contact(
id="C000123",
Email="newemail@example.com"
)
updated = client.contacts.put_entity(update)
Troubleshooting
ImportError: cannot import name "Bill"
Problem: Trying to import models directly
Solution: Use client.models.Bill instead of importing
Solution: Use client.models.Bill instead of importing
AttributeError: "Client" object has no attribute "bills"
Problem: Using old Client class instead of AcumaticaClient
Solution: Change to AcumaticaClient and ensure proper initialization
Solution: Change to AcumaticaClient and ensure proper initialization
No autocomplete in IDE
Problem: Type stubs not generated
Solution: Run generate_stubs_from_client() after connecting
Solution: Run generate_stubs_from_client() after connecting
Custom fields not appearing
Problem: Looking for custom fields as direct attributes
Solution: Access via the "custom" dictionary on the model
Solution: Access via the "custom" dictionary on the model
Migration Benefits
Zero Maintenance
Models update automatically when your instance changes
Custom Field Support
All custom fields are discovered and available
Always Current
No more version mismatches with your instance
Full Type Safety
Complete IDE support with generated stubs
Smaller Package
No bundled model definitions to maintain
Better API Coverage
Access to all endpoints and operations