=== MonresPro Order Sync for Odoo ===
Contributors: monrespro
Tags: odoo, erp, orders, sync, sales
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.5.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically send WooCommerce orders and customers into Odoo as sale.order and res.partner, matched to your products by SKU.

== Description ==

MonresPro Order Sync for Odoo connects your WooCommerce store to Odoo. As soon as an order
reaches the status you choose, it is created in Odoo as a **sale.order**, with
its customer (**res.partner**) and its lines matched to your Odoo products by
SKU. No CSV exports, no copy-paste, no middleware subscription.

Syncing runs in the background on WooCommerce's Action Scheduler, off the
customer's checkout request, and retries on its own with an exponential backoff
if Odoo is briefly unreachable — so a network blip never loses an order.

= Free features =

* Orders → Odoo `sale.order` (line items, quantities, fees and shipping; unmatched lines kept as notes so nothing is lost).
* Customers → `res.partner`, de-duplicated by email, with billing address and phone.
* Product matching by SKU (`default_code`); prices come from the order so Odoo totals match WooCommerce.
* Create the Odoo order as a draft quotation or confirm it automatically.
* Order status back from Odoo → WooCommerce (sale → processing, done → completed, cancel → cancelled).
* One-click connection test, background queue with retries, and a sync log.
* Per-order Odoo panel: direct link to Odoo, current state, and manual Export / Re-export / Check status actions.
* Compatible with High-Performance Order Storage (HPOS).

= Pro features =

* Product, price and stock sync between Odoo and WooCommerce (scheduled or real-time).
* Refunds and credit notes.
* Multi-warehouse, advanced tax and account mapping.
* Priority support.

= Works with =

Any Odoo that exposes the external API over XML-RPC — Odoo Online (SaaS),
Odoo.sh and self-hosted, recent versions (14 and up).

= Trademarks =

Odoo is a trademark of Odoo S.A. WooCommerce is a trademark of Automattic Inc.
This plugin is an independent integration and is not affiliated with, endorsed
by, or sponsored by Odoo S.A. or Automattic Inc. Those names are used only to
describe what the plugin connects to.

== External services ==

This plugin relies on two external services.

1) Your Odoo instance (the integration itself).
You provide the URL, database, user and API key of your own Odoo server. When an
order syncs, the plugin sends that order's data — customer name, email, phone and
billing address, product names and SKUs, quantities, prices, totals and order
status — to your Odoo server over its external API (XML-RPC, endpoints
/xmlrpc/2/common and /xmlrpc/2/object). It also reads the order state back from
Odoo. Data is sent only to the instance you configure and only when an order is
synced or when you use the connection test. If your instance is hosted by Odoo
S.A., their terms and privacy policy apply: https://www.odoo.com/terms and
https://www.odoo.com/privacy

2) Freemius (licensing, updates and optional analytics).
Software licensing, the Pro upgrade/checkout and update delivery are handled by
Freemius. On activation you may opt in to share basic site and usage information
with Freemius to help improve the plugin; this opt-in is optional and can be
skipped. Purchases are processed on Freemius' checkout. Freemius terms:
https://freemius.com/terms/ and privacy policy: https://freemius.com/privacy/

No order or customer data is sent to Freemius or to any party other than your
own Odoo instance.

== Installation ==

1. Install and activate the plugin (WooCommerce must be active).
2. In Odoo: Preferences → Account Security → generate a new API key.
3. In WordPress: WooCommerce → Odoo Sync. Enter your Odoo URL, database, user and API key.
4. Click "Test connection", save, then enable syncing and pick the trigger status.

== Frequently Asked Questions ==

= Which Odoo versions are supported? =

Any Odoo that exposes the external API over XML-RPC — Odoo Online, Odoo.sh and
self-hosted, recent versions (14 and up). You connect with a database name, a
user and an API key generated in Odoo under Preferences → Account Security.

= What happens if a product isn't in Odoo yet? =

The order still syncs. Matched lines become real order lines; an unmatched SKU
is kept as a note line on the sale.order and flagged in the log, so your Odoo
order is never missing an item. Automatic product creation is on the Pro roadmap.

= Will it slow down my store? =

No. Syncing runs in the background on WooCommerce's Action Scheduler, off the
checkout request. If Odoo is briefly unreachable, the job retries with an
exponential backoff instead of failing the order.

= Is my data sent anywhere else? =

Order and customer data is sent only to the Odoo instance you configure. See the
"External services" section above for the full details, including Freemius, which
handles licensing and updates.

= Is it compatible with High-Performance Order Storage (HPOS)? =

Yes. It declares HPOS compatibility and reads orders through the WooCommerce
order API, so it works whether you use legacy post storage or custom order tables.

== Screenshots ==

1. Orders flow from WooCommerce into Odoo as sale.order, mapped by SKU.
2. Connection settings and one-click connection test.
3. Per-order Odoo panel: link, status and manual actions.

== Changelog ==

= 0.5.1 =
* Author URI now points to https://www.monrespro.com (same organisation as the plugin author).

= 0.5.0 =
* Trigger on multiple order statuses: pick one or several statuses (checkboxes) that start the export, instead of a single one. An order is still exported only once. Existing single-status settings keep working.

= 0.4.0 =
* Renamed to "MonresPro Order Sync for Odoo" (slug monrespro-order-sync-for-odoo) with a clear trademark/unaffiliation notice.
* Admin scripts are now enqueued (wp_enqueue_script + wp_add_inline_script) instead of printed inline.
* Removed the unneeded load_plugin_textdomain() call (WordPress loads translations automatically since 4.6).
* readme: tested up to WordPress 7.1; stable tag aligned with the plugin version.

= 0.3.0 =
* Freemius integration (licensing, Pro upgrade, updates). The Freemius SDK must be present in /freemius; without it the plugin remains fully functional.
* readme: external services disclosure (Odoo, Freemius).

= 0.2.1 =
* Renamed to "MonresPro Odoo Sync" (slug monrespro-order-sync-for-odoo).

= 0.2.0 =
* Per-order Odoo panel: direct link, status, and manual actions (Export / Re-export / Check status).
* Order status Odoo → WooCommerce (optional): sale → processing, done → completed, cancel → cancelled. Hourly check plus on-demand.

= 0.1.0 =
* Initial release: Odoo connection, connection test, order and customer export, SKU product matching, log and retries.

== Upgrade Notice ==

= 0.5.0 =
You can now trigger the export on several order statuses at once.

= 0.4.0 =
Plugin renamed to "MonresPro Order Sync for Odoo", scripts properly enqueued, and readme updated for WordPress 7.1.

= 0.3.0 =
Adds Freemius for licensing and updates, and documents the external services used.
