Custom PDF Template File Location

I would like to create a new document template for my proposals. Following the Create a PDF document template documentation is pretty easy to do.

The documentation states:

Do not modify an existing template. Copy the file of the template used as example into a new name in same directory than your example and edit it to change content.

What I would like to do is copy the template to a different directory. Specifically, dolibarr/htdocs/custom where all of my other custom code resides, like triggers, hooks, custom modules, etc.

I am not seeing a good way to do that and am wondering if anyone has tried to do this before or has any suggestions on how to achieve this.

Hello,

You need to create a module, and have the

							'models' => 1,                                   	// Set this to 1 if module has its own models directory (core/modules/xxx)

on $this->module_parts

Then put your models on /custom/mybieautifullmodule/core/modules/propale/doc

Then activate the module, and you should see the new template on propal module configuration.

Then activate the new template

2 Likes

@ksar
What a simple solution! Thank you!