Creating a document template within a custom module

Ciao,
my custom module must contain the templates of some documents (invoices, orders, …).
Following the wiki, I derived my class from an existing one (eg crabe for the invoice), saving my php in the same folder I started from, and the new template appears in the list and can be used correctly.

But I don’t understand how to move the file inside my custom module folder (e.g. custom / mymodule / core / modules / doc).
How can I do?

Thank you

1 Like

Did you ever figure this out? I would like to do something like this as well. I would like my custom module to include my own custom templates for the various core modules, like invoices, proposals, etc. It would be much easier to keep them all in my core module for version control reasons.
Thanks!
Jeff

Hi Jeff,
too much time has passed and… I forgot everything :slight_smile:
From memory I think I abandoned that project.

I’m sorry

Hi,
months later the same problem reoccurs, I hadn’t solved it then :slight_smile:
The Wiki page suggests creating the template file in the Dolibarr core folders, (eg, htdocs\core\modules\commande\doc) and that works.
I wanted to attach it to my module instead.
Putting my file in the module folder (e.g. custom/ mymodule/core/modules/ commande/doc) and, also adding the corresponding record in the llx_document_model table, my template doesn’t appear in the list

This works but it is bad practice!

I edited the wiki with more up to date instructions

Perfect, thank you very much, I took a look and it works