How to remove/omit odt templete name from auto document generated

Hi,

Can anyone help me with how I can omit the odt template name from the file that is generated with a .odt template?

In my case, I am using the NS{yy}{mm}/QT/{000@1} Mask for the Proposal. e.g the name should be NS2209/QT/001 but I am getting NS2209/QT/001_Quote.pdf while using the Quote.odt template.

Is it possible to eliminate the part of the filename?

Thanks in advance.

Hello :slight_smile:

can you rename your odt file as “template_.odt”, and make a try

in core/modules/propale/doc, the script doc_generic_proposal_odt.modules.php contains this code that permits to rename the file result name …

Good continuation

Thank you for the support, I did try the “template_.odt” and it worked but it’s adding the ‘_’ after the mask.

Secondly, if I have more than one template for the proposal, how can I rename multiple template files which should not add the template name.

Can we disable or modify this function to achieve the goal?

you can do it, by changing the php script…
add a new line just after the last line in the portion of code of my last post

  • $newfiletmp = $objectref;

Good continuation

1 Like

Thank you so much, adding your code line solved the issue. :slightly_smiling_face:

One more thing please whenever I generate the using doc odt template, I am getting the following Warning

Warning : md5_file(c:/dolibarr/dolibarr_documents/propale/(PROV8)/(PROV8).odt): failed to open stream: No such file or directory in C:\dolibarr\www\dolibarr\htdocs\core\class\commonobject.class.php on line 5419