From 86d6de65793e807e6629f45e14d7af35a7396756 Mon Sep 17 00:00:00 2001
From: Christophe Dumez <christophe@nexedi.com>
Date: Thu, 3 Aug 2006 14:53:39 +0000
Subject: [PATCH] - added function setDomainRootFromParam() to set the root of
 a listbox in tree mode given the name of the root

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9033 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/SelectionTool.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/product/ERP5Form/SelectionTool.py b/product/ERP5Form/SelectionTool.py
index 7cad999c36..3fadd10311 100644
--- a/product/ERP5Form/SelectionTool.py
+++ b/product/ERP5Form/SelectionTool.py
@@ -690,6 +690,13 @@ class SelectionTool( UniqueObject, SimpleItem ):
       if REQUEST is not None:
         return self._redirectToOriginalForm(REQUEST=REQUEST, form_id=form_id,
                                             query_string=query_string)
+                                            
+    security.declareProtected(ERP5Permissions.View, 'setDomainRootFromParam')
+    def setDomainRootFromParam(self, REQUEST, selection_name, domain_root):
+      if REQUEST is None:
+        return
+      selection = self.getSelectionFor(selection_name, REQUEST)
+      selection.edit(domain_path=domain_root, domain_list=())
 
     security.declareProtected(ERP5Permissions.View, 'unfoldDomain')
     def unfoldDomain(self, REQUEST, form_id=None, query_string=None):
-- 
2.30.9