[Erp5-report] r7295 - in /erp5/trunk/products/ERP5: Document/ Tool/
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue May 16 16:20:51 CEST 2006
Author: chris
Date: Tue May 16 16:20:43 2006
New Revision: 7295
URL: http://svn.erp5.org?rev=7295&view=rev
Log:
Added a script that return the id of the original business template where the given object is coming from.
Modified:
erp5/trunk/products/ERP5/Document/BusinessTemplate.py
erp5/trunk/products/ERP5/Tool/TemplateTool.py
Modified: erp5/trunk/products/ERP5/Document/BusinessTemplate.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/BusinessTemplate.py?rev=7295&r1=7294&r2=7295&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessTemplate.py (original)
+++ erp5/trunk/products/ERP5/Document/BusinessTemplate.py Tue May 16 16:20:43 2006
@@ -356,6 +356,9 @@
def export(self, context, bta, **kw):
pass
+ def getKeys(self):
+ return self._objects.keys()
+
def importFile(self, bta, **kw):
bta.importFiles(klass=self)
@@ -4278,6 +4281,15 @@
for item_name in self._item_name_list:
getattr(self, item_name).importFile(bta)
+ #By christophe Dumez <christophe at nexedi.com>
+ def getItemsList(self):
+ """Return list of items in business template
+ """
+ items_list = []
+ for item_name in self._item_name_list:
+ item = getattr(self, item_name)
+ items_list.extend(item.getKeys())
+ return items_list
def diffObject(self, REQUEST, **kw):
"""
Modified: erp5/trunk/products/ERP5/Tool/TemplateTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Tool/TemplateTool.py?rev=7295&r1=7294&r2=7295&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Tool/TemplateTool.py (original)
+++ erp5/trunk/products/ERP5/Tool/TemplateTool.py Tue May 16 16:20:43 2006
@@ -102,6 +102,15 @@
if bt.getInstallationState() == 'installed' and bt.getTitle() == title:
return bt
return None
+
+ def getInstalledBusinessTemplatesList(self):
+ """Get list of installed business templates
+ """
+ installed_bts = []
+ for bt in self.contentValues(filter={'portal_type':'Business Template'}):
+ if bt.getInstallationState() == 'installed':
+ installed_bts.append(bt)
+ return installed_bts
def updateLocalConfiguration(self, template, **kw):
"""
More information about the Erp5-report
mailing list