From 1f0c04a8a94e808080a4ac083ec377ecd6c62b67 Mon Sep 17 00:00:00 2001
From: Simnandez <jmenent@2byte.es>
Date: Fri, 27 Jan 2012 22:35:23 +0100
Subject: [PATCH] [ task #176 ] Allow to use ODT templates. Works with Orders

---
 htdocs/core/modules/modCommande.class.php | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php
index 4ce90bc9178..9e4cea75084 100644
--- a/htdocs/core/modules/modCommande.class.php
+++ b/htdocs/core/modules/modCommande.class.php
@@ -200,6 +200,12 @@ class modCommande extends DolibarrModules
 		// Permissions
 		$this->remove();
 
+		//ODT template
+		require_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php');
+		$dirodt=DOL_DATA_ROOT.'/doctemplates/orders';
+		create_exdir($dirodt);
+		dol_copy(DOL_DOCUMENT_ROOT.'/install/doctemplates/orders/template_order.odt',$dirodt.'/template_order.odt',0,0);
+		
 		$sql = array(
 		 "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][2]."'",
 		 "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES('".$this->const[0][2]."','order')"
-- 
GitLab