Thanks in advance for any guidance!
To pytanie dostało ostrzeżenie
Odoo's XML-RPC/JSON-RPC API does not expose session_id for anonymous cart tracking - sessions are handled server-side via HTTP cookies and not accessible through the standard API. Here are the recommended approaches:
- Use the sale.order access_token: Each sale.order has an access_token field. When creating an anonymous cart via API, read and store this token client-side (cookie/localStorage). Use it to filter/retrieve the specific cart: search sale.order where access_token = your_stored_token.
2. Use Odoo HTTP controllers instead of XML-RPC: Make HTTP requests with session cookies to Odoo website endpoints (/shop/cart/update, /web/dataset/call_kw). This preserves the server session and handles anonymous cart linking natively.
3. Custom client identifier field: Add a custom field (e.g., client_uuid) to sale.order via Studio. Generate a UUID client-side, send it when creating a cart, and use it to retrieve the cart later. This is the cleanest pure-API approach.
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj się| Powiązane posty | Odpowiedzi | Widoki | Czynność | |
|---|---|---|---|---|
|
|
3
lis 25
|
3939 | ||
|
|
2
wrz 25
|
5774 | ||
|
|
1
gru 24
|
9119 | ||
|
|
0
lut 17
|
4589 | ||
|
|
1
maj 26
|
3664 |