Commit 42b3b5b3 authored by Jérome Perrin's avatar Jérome Perrin

when guessing the name of the temp method, only replace the first occurence of "add"



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9213 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6e7d6a25
...@@ -343,7 +343,7 @@ class ERP5TypeInformation( FactoryTypeInformation, ...@@ -343,7 +343,7 @@ class ERP5TypeInformation( FactoryTypeInformation,
from Products.ERP5Type import Document from Products.ERP5Type import Document
# Access the factory method for temp object by guessing it # Access the factory method for temp object by guessing it
# according to ERP5 naming conventions (not very nice) # according to ERP5 naming conventions (not very nice)
factory_method_id = self.factory.replace('add', 'newTemp') factory_method_id = self.factory.replace('add', 'newTemp', 1)
if not factory_method_id.startswith('newTemp'): if not factory_method_id.startswith('newTemp'):
raise raise
factory_method = getattr(Document, factory_method_id) factory_method = getattr(Document, factory_method_id)
......
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