Commit ba7eec4f authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_corporate_identity: XXXhack for sale opprtunity

asked by jp
parent 055cc761
......@@ -40,13 +40,22 @@ if doc_content.find('${WebPage_') != -1:
limit=1
)]
if document_required_follow_up_list:
substitution_list = re.findall(r'\${WebPage_(.*)}', doc_content)
for substitution_report in substitution_list:
if substitution_report == 'insertTableOfReferences':
continue
substitution_content = getReportViaFancyName(substitution_report, document_required_follow_up_list[0])
if substitution_content:
doc_content = doc_content.replace('${WebPage_%s}' % substitution_report, substitution_content)
if document_required_follow_up_list[0].getPortalType() == 'Sale Opportunity':
tmp_follow_up = None
for tmp in document_required_follow_up_list[0].getFollowUpRelatedValueList(portal_type='Requirement Document'):
if tmp.getValidationState() == "validated":
tmp_follow_up = tmp
break
else:
tmp_follow_up = document_required_follow_up_list[0]
if tmp_follow_up:
substitution_list = re.findall(r'\${WebPage_(.*)}', doc_content)
for substitution_report in substitution_list:
if substitution_report == 'insertTableOfReferences':
continue
substitution_content = getReportViaFancyName(substitution_report, tmp_follow_up)
if substitution_content:
doc_content = doc_content.replace('${WebPage_%s}' % substitution_report, substitution_content)
# new handler
# fetch reports same way as embedding documents = via links, like:
......
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