OdooWoo Invoices
Receives invoices from OdooWoo and lets customers download them from My Account, behind the shop's own login.
Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/beltoftandersen/odoowoo-invoices/archive/refs/heads/main.zipWordPress plugin for the WooCommerce shop. It receives invoices that OdooWoo pushes when an invoice is posted in Odoo, stores the PDF against the order, and lets the customer download it from My Account, behind the shop's own login.
How it works
- OdooWoo posts a signed JSON message (invoice number, date, total and the PDF) to
POST /wp-json/odoowoo-invoices/v1/invoice. - The plugin checks the signature, stores the PDF under
wp-content/uploads/odoowoo-invoices/with a random file name, and adds an order note. - My Account → Orders shows a Download invoice button, and the order page lists all invoices. Shop managers see the links on the order screen.
- Files never have a public URL. Downloads go through
admin-post.php?action=odoowoo_invoiceand are allowed only for the order's customer, shop managers, or, for guest orders, a visitor holding the order key.
Setup
- Install and activate the plugin (WooCommerce required).
- WooCommerce → OdooWoo Invoices: paste the webhook secret of your OdooWoo dashboard. Alternatively define
ODOOWOO_INVOICES_SECRETinwp-config.php. - In the OdooWoo dashboard, switch on sending invoices to the shop.
- Your Odoo needs the current OdooWoo helper module (it provides
render_invoice_pdf_by_id).
Without a secret the endpoint refuses every request.
nginx
.htaccess is ignored by nginx. File names are random 128-bit values and nothing links to them, but block the folder as well:
location ^~ /wp-content/uploads/odoowoo-invoices/ { deny all; return 404; }
Signature
Headers X-OdooWoo-Timestamp (unix seconds, at most 5 minutes old) and X-OdooWoo-Signature: lowercase hex HMAC-SHA256, key = the shared secret, over <timestamp>.<raw request body>.
Development
/root/plugin-tests/run.sh /var/www/wordpress/workspaces/odoowoo-invoices
Uninstalling removes the saved secret only. Stored invoices are customer records and stay in uploads/odoowoo-invoices/.
GPL-2.0-or-later.