Question: How can I add an Excel button to export the “État du stock” in Dolibarr?
Hi everyone ![]()
I’m customizing Dolibarr and I would like to add a new button named “Excel” on the Product Stock Card page:
http://localhost:70/backuporo/product/stock/card.php?id=3&save_lastsearch_values=1
When I click this “Excel” button, I want Dolibarr to generate and download an Excel file containing the current stock report (État du stock) — for example, the list of warehouses, available quantities, movements, etc.
I would like to know:
Which file(s) should I modify to add this button?
What is the best way to export the data? (use PhpSpreadsheet, existing Dolibarr helper, or a built-in export function?)
Is there maybe already a function or module that allows stock export in Excel?
From what I found, the page I need to edit seems to be:
/htdocs/product/stock/card.php
If anyone has an example or snippet for adding an action=exportexcel or dolGetButtonTitle() button that generates an Excel export, it would be super helpful ![]()
Thanks in advance for your help!




