Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.29k stars 2.74k forks source link

Send mass email for invoices generated from ODT template. #12620

Closed verbatime closed 1 year ago

verbatime commented 4 years ago

Bug

When we select mass action "send mail" for invoices generated from an ODT template, it doesn't work. Message : "Failed to read /home/**/documents/facture/FA1908-0001/FA1908-0001.pdf"

Environment

Version: 10.0.4 and lower OS: Linux / CentOS 7 PHP: 7.2 Database: MySQL URL(s): /compta/facture/list.php

Expected and actual behavior

It should send emails with pdf invoice for each selected invoice.

Steps to reproduce the behavior

1) Generate min 2 invoices from an odt template 2) From /compta/facture/list.php select invoices 3) Select mass action "send mail" 4) Send emails 5) See error

ksar-ksar commented 4 years ago

Hi,

Has explained in the french forum, this is most probably linked to your installation. The translation tool is excute with root, so the generated document in pdf is owned by root. Then php can't read it.

Need an investiagation on your system

dpriskorn commented 4 years ago

Update to v12 and reopen if the problem persists.

daxitsolutions commented 2 years ago

Hello, I would like to reopen this issue because this is not linked with the configuration. @ksar-ksar @dpriskorn

Case : Use an ODT template called "template_facture_something.odt" When you generate the PDF, the filename generated for an invoice will be "REFOFTHEINVOICE_facture_something.pdf" for me "FAC2110-00029_facture_nomduclient.pdf"

Occurs on Dolibarr 13.0.3

Error detail Échec de lecture du fichier '/var/www/xxxx-erp/dolibarr-13.0.3/documents/facture/FAC2110-00004 Échec de lecture du fichier '/var/www/xxx-erp/dolibarr-13.0.3/documents/facture/FAC2110-00003/FAC2110-00003.pdf' ....

On the server : `xxxxx@production-xxxxx:/var/www/xxxxx-erp/dolibarr-13.0.3/documents/facture/FAC2110-00003$ ls

FAC2110-00003_facture_nomduclient.pdf`

daxitsolutions commented 2 years ago

Workaround applied on the server side : (in a cron)

find /var/www/wittamer-erp/dolibarr-14.0.4/documents/ -depth -name "FA_TEMPLATENAME.pdf" | while IFS= read -r ent; do cp $ent ${ent%_TEMPLATENAME}${ent##_TEMPLATENAME}; chown www-data ${ent%_TEMPLATENAME}${ent##_TEMPLATENAME}; rm $ent; done

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 1 year with no activity. If this is a bug, please comment to confirm it is still present on latest stable version. if this is a feature request, please comment to notify the request is still relevant and not yet covered by latest stable version. This issue may be closed automatically by stale bot in 10 days (you should still be able to re-open it if required).

daxitsolutions commented 1 year ago

This is still an issue.