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