Commit e96a8407 authored by Fabien Morin's avatar Fabien Morin

add a method to copy all subobjects using the model_reference_dict (wich is...

add a method to copy all subobjects using the model_reference_dict (wich is the result of the two previous methods)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18321 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 69332628
...@@ -122,3 +122,16 @@ class PaySheetModel(TradeCondition, XMLMatrix): ...@@ -122,3 +122,16 @@ class PaySheetModel(TradeCondition, XMLMatrix):
reference_list=reference_list,) reference_list=reference_list,)
return model_reference_dict 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)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment