=== Fusion WooDoo ===
Contributors: fusioncentral
Tags: woocommerce, odoo, integration, erp, orders, invoices, inventory, sync
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
Stable tag: 1.0.0
WC requires at least: 8.0
WC tested up to: 9.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Seamless Odoo 19 integration for WooCommerce — sync orders, invoices, deliveries, and inventory in real time.

== Description ==

Fusion WooDoo bridges your WooCommerce store with an Odoo 19 instance running the `fusion_woocommerce` module. It provides:

* **Real-time order sync** via WooCommerce webhooks → Odoo
* **Status & tracking push-back** from Odoo → WooCommerce order meta
* **Customer portal tabs** in My Account: Sales Orders, Invoices, Deliveries, Returns
* **Visual order timeline** on the order detail page (Confirmed → Processing → Shipped → Delivered → Completed)
* **Invoice & delivery PDF storage** — Odoo pushes base64-encoded PDFs; customers download securely
* **Return requests** — customers submit returns from their account; routed to Odoo automatically
* **Odoo message thread** display on order detail pages
* **Admin settings page** under WooCommerce with one-click connection test and webhook status dashboard

== Requirements ==

* WordPress 6.0 or higher
* WooCommerce 8.0 or higher
* PHP 8.0 or higher
* Odoo 19 with the `fusion_woocommerce` Odoo module installed and configured

== Installation ==

1. Upload the `fusion-woodoo` folder to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Go to **WooCommerce → Fusion WooDoo** in the WordPress admin.
4. Enter your Odoo base URL (e.g. `https://erp.example.com`) and the API key generated in the Odoo `fusion_woocommerce` module settings.
5. Save — webhooks will be registered automatically.
6. Click **Test Connection** to verify Odoo is reachable.

== Frequently Asked Questions ==

= Where do I get the API key? =

In Odoo, open the `fusion_woocommerce` module settings and copy the generated API key. Paste it into **WooCommerce → Fusion WooDoo → API Key**.

= Which WooCommerce webhooks does the plugin register? =

Five webhooks: `order.created`, `order.updated`, `product.updated`, `customer.created`, and `customer.updated`. All point to your Odoo instance. They are removed automatically on plugin deactivation.

= Where are invoice and delivery PDFs stored? =

Under `wp-content/uploads/fusion-woodoo/invoices/` and `.../deliveries/`. Both directories are protected by `.htaccess` (deny from all). PDFs are served only to the order owner via a signed AJAX request.

= Can customers reorder from the Sales Orders tab? =

Yes — the Reorder button adds all items from a previous order to the WooCommerce cart.

= How do I hide portal tabs I don't need? =

Go to **WooCommerce → Fusion WooDoo** and uncheck the portal tab toggles you want to hide.

== Screenshots ==

1. Admin settings page — connection details and webhook status.
2. My Account — Sales Orders tab.
3. My Account — Invoices tab with PDF download.
4. My Account — Deliveries tab with tracking links.
5. My Account — Returns tab with request form.
6. Order detail page — visual timeline.

== Changelog ==

= 1.0.0 =
* Initial release.
* Admin settings with connection test and webhook status.
* WP REST API endpoints: order/update, order/invoice, order/delivery, order/messages.
* WooCommerce webhook registration for orders, products, and customers.
* My Account portal tabs: Sales Orders, Invoices, Deliveries, Returns.
* Visual order timeline on order detail pages.
* Secure PDF download handler.
* Return request form with Odoo submission.
* Odoo message thread display.

== Upgrade Notice ==

= 1.0.0 =
Initial release — no upgrade steps required.
