OPEN-DSI / ecommerceng_woosync

WooSync, synchronize Woocommerce and Dolibarr
GNU General Public License v3.0
71 stars 46 forks source link

Use of deprecated Dolibarr field #92

Open madmaxpt opened 1 year ago

madmaxpt commented 1 year ago

The field "modelpdf" is deprecated since Dolibarr 14 (https://github.com/Dolibarr/dolibarr/blob/develop/htdocs/core/class/commonobject.class.php#L436) and when saving an invoice to the database, Dolibarr stores the content of the "model_pdf" variable : https://github.com/Dolibarr/dolibarr/blob/develop/htdocs/compta/facture/class/facture.class.php#L2546

Since Woosync only uses the deprecated field (https://github.com/OPEN-DSI/ecommerceng_woosync/blob/2022.5.3/class/business/eCommerceSynchro.class.php#L5014), its content is never stored in the database and when the invoice is refreshed (https://github.com/OPEN-DSI/ecommerceng_woosync/blob/2022.5.3/class/business/eCommerceSynchro.class.php#L5873), it is always reset to empty and the invoice PDF is never generated when synchronising orders from Woocommerce

Consider setting the new field or using the setDocModel method which sets both variables (https://github.com/Dolibarr/dolibarr/blob/develop/htdocs/core/class/commonobject.class.php#L2876)