[Erp5-report] r18321 - /erp5/trunk/products/ERP5/Document/PaySheetModel.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Dec 13 23:04:29 CET 2007
Author: fabien
Date: Thu Dec 13 23:04:29 2007
New Revision: 18321
URL: http://svn.erp5.org?rev=18321&view=rev
Log:
add a method to copy all subobjects using the model_reference_dict (wich is the result of the two previous methods)
Modified:
erp5/trunk/products/ERP5/Document/PaySheetModel.py
Modified: erp5/trunk/products/ERP5/Document/PaySheetModel.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/PaySheetModel.py?rev=18321&r1=18320&r2=18321&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/PaySheetModel.py (original)
+++ erp5/trunk/products/ERP5/Document/PaySheetModel.py Thu Dec 13 23:04:29 2007
@@ -122,3 +122,16 @@
reference_list=reference_list,)
return model_reference_dict
+ def copyInheritanceSubObjects(self, model_reference_dict):
+ '''
+ copy all sub objects containing in the dict into the current model
+ '''
+ key_list = model_reference_dict.keys()
+
+ for key in key_list:
+ id_list = model_reference_dict[key]
+ model = self.getPortalObject().restrictedTraverse(key)
+ if model is None:
+ LOG("copyInheritanceSubObjects,", 0, "can't find model %s" % key)
+ copied_data = model.manage_copyObjects(ids=id_list)
+ self.manage_pasteObjects(copied_data)
More information about the Erp5-report
mailing list