Odoo Integration
The middleware communicates with Odoo via XML-RPC using XmlRpcOdooClient.
Available Methods
| Method | Purpose |
|---|---|
authenticate() |
Authenticate and get user ID |
create(model, fields) |
Create a record in Odoo |
write(model, id, fields) |
Update a record in Odoo |
search(model, domain) |
Search for record IDs |
read(model, ids, fields) |
Read records by ID |
batch(operations) |
Execute multiple operations |
Serializer Pattern
Each entity type has a dedicated serializer implementing EntitySerializerInterface:
interface EntitySerializerInterface
{
public function serialize(array $data): array; // Middleware -> Odoo format
public function deserialize(array $data): array; // Odoo -> Middleware format
public function getOdooModel(): string; // e.g., "res.partner"
}
Implementations: PartnerSerializer, SaleOrderSerializer. The SerializerRegistry provides lookup by entity type.