fix(client): map customer_id to socid in create_invoice (BUG-1)

This commit is contained in:
Benju1
2025-12-05 03:11:20 +01:00
parent 00d62bc450
commit 809e8f0c59

View File

@@ -388,6 +388,11 @@ class DolibarrClient:
) -> Dict[str, Any]:
"""Create a new invoice."""
payload = self._merge_payload(data, **kwargs)
# Fix: Map customer_id to socid
if "customer_id" in payload and "socid" not in payload:
payload["socid"] = payload.pop("customer_id")
result = await self.request("POST", "invoices", data=payload)
return self._extract_identifier(result)