odoo-testing-addons/UBER_INTEGRATION_GUIDE.md

62 lines
2.9 KiB
Markdown

# Dine360 Uber Integration Guide
This guide explains how to configure and use the Uber Integration module in your Odoo system.
## 1. Configuration (Set up API)
Before you can use the integration, you must link your Odoo instance with your Uber Developer account.
### Steps:
1. **Open Settings**: On your Odoo dashboard, click the **Uber Integration** icon.
2. **Create New Config**: Click **New** to create a configuration.
3. **Enter Credentials**:
* **Name**: Give it a descriptive name (e.g., "Main Store Uber").
* **Environment**: Set to **Sandbox** for testing or **Production** for live orders.
* **Client ID & Client Secret**: Get these from your [Uber Developer Dashboard](https://developer.uber.com/).
* **Customer ID**: Required only for **Uber Direct** (last-mile delivery).
4. **Test Connection**: Click the **Test Connection** button to verify that Odoo can talk to Uber.
---
## 2. Detailed Workflow
The module handles two main flows: **Uber Eats (Incoming Orders)** and **Uber Direct (Outgoing Delivery)**.
### A. Uber Eats Workflow (Incoming)
1. **Syncing**: Odoo periodically checks for new orders on the Uber Eats platform.
2. **POS Creation**: When a new order is found, Odoo automatically creates a **POS Order** with the `is_uber_order` flag.
3. **KDS Notification**: If the `dine360_kds` module is active, the order is immediately sent to the kitchen display for preparation.
4. **Automatic Confirmation**: Once processed, Odoo sends a confirmation back to Uber so the customer knows their food is being prepared.
### B. Uber Direct Workflow (Outgoing Delivery)
This is used when a customer orders directly through your POS, but you want to use an Uber driver for delivery.
1. **Create Order**: Create a normal POS order for a customer.
2. **Payment**: Confirm the payment and validate the order.
3. **Request Delivery**:
* Open the validated Order form.
* Click the **"Request Uber Delivery"** button.
* Odoo sends the order details (pickup address, dropoff address, items) to Uber.
4. **Tracking**: Odoo receives an **Uber Delivery ID**.
5. **Live Updates**: As the Uber driver moves, Odoo receives webhooks and automatically updates the `Uber Status` field on the order:
* `Pending`: Order sent to Uber, looking for driver.
* `Pickup`: Driver arrived at restaurant.
* `In Transit`: Driver is on the way to the customer.
* `Delivered`: Order completed!
---
## 3. Webhook Setup (Crucial for Live Tracking)
To get real-time status updates (like "Driver arrived"), you must configure the Webhook URL in your Uber Developer Portal:
* **Webhook URL**: `https://your-odoo-domain.com/uber/webhook/delivery`
* **Method**: `POST`
---
## 4. Technical Architecture
* **Module Name**: `dine360_uber`
* **Security**: Restricted to `Point of Sale / Manager` group.
* **Persistence**: All Uber statuses are stored directly on the `pos.order` record for easy reporting.