Commit ba7eec4f authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_corporate_identity: XXXhack for sale opprtunity

asked by jp
parent 055cc761
...@@ -40,11 +40,20 @@ if doc_content.find('${WebPage_') != -1: ...@@ -40,11 +40,20 @@ if doc_content.find('${WebPage_') != -1:
limit=1 limit=1
)] )]
if document_required_follow_up_list: if document_required_follow_up_list:
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) substitution_list = re.findall(r'\${WebPage_(.*)}', doc_content)
for substitution_report in substitution_list: for substitution_report in substitution_list:
if substitution_report == 'insertTableOfReferences': if substitution_report == 'insertTableOfReferences':
continue continue
substitution_content = getReportViaFancyName(substitution_report, document_required_follow_up_list[0]) substitution_content = getReportViaFancyName(substitution_report, tmp_follow_up)
if substitution_content: if substitution_content:
doc_content = doc_content.replace('${WebPage_%s}' % substitution_report, substitution_content) doc_content = doc_content.replace('${WebPage_%s}' % substitution_report, substitution_content)
......
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