From 73a2f6f95f02c65c29c5e3bfcd6edb92facf80d2 Mon Sep 17 00:00:00 2001
From: Jean-Paul Smets <jp@nexedi.com>
Date: Sun, 30 Sep 2007 22:16:47 +0000
Subject: [PATCH] Make sure that if a document is copied to preference, it is
 considered as a template.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16732 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/CopySupport.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/product/ERP5Type/CopySupport.py b/product/ERP5Type/CopySupport.py
index 203ef7be43..4737cba4e2 100644
--- a/product/ERP5Type/CopySupport.py
+++ b/product/ERP5Type/CopySupport.py
@@ -301,6 +301,9 @@ class CopyContainer:
         except WorkflowException:
           pass
 
+    if self.getParentValue().getPortalType() == 'Preference':
+      # Make this a template if our parent is a preference
+      self.makeTemplate()
 
     self.__recurse('manage_afterClone', item)
 
-- 
2.30.9