Commit 93e3fab0 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_corporate_identity: fix embed report issue

For options:
${WebPage_insertFollowUpCostEffortReport}
${WebPage_insertFollowUpCostEffortDetailReport}
script's name is changed to Base_generateCostEffortReportContent
and parameter is changed also
parent 314d49fb
...@@ -16,7 +16,8 @@ document = context ...@@ -16,7 +16,8 @@ document = context
# backcompat # backcompat
def getReportViaFancyName(my_report_name): def getReportViaFancyName(my_report_name):
for follow_up in document_required_follow_up_list: for follow_up in document_required_follow_up_list:
report_name = follow_up.split("insertFollowUp").pop().split("Report")[0] #report_name = follow_up.split("insertFollowUp").pop().split("Report")[0]
report_name = my_report_name.split("insertFollowUp").pop().split("Report")[0]
detail_name = "Detail" in report_name detail_name = "Detail" in report_name
coverage_name = "Coverage" in report_name coverage_name = "Coverage" in report_name
...@@ -24,17 +25,18 @@ def getReportViaFancyName(my_report_name): ...@@ -24,17 +25,18 @@ def getReportViaFancyName(my_report_name):
if detail_name: if detail_name:
report_name = report_name.replace("Detail", "") report_name = report_name.replace("Detail", "")
method_name = ''.join(['Base_render', report_name, 'TextDocumentReportAsHtml']) #method_name = ''.join(['Base_render', report_name, 'TextDocumentReportAsHtml'])
method_name = ''.join(['Base_generate', report_name, 'Report'])
method_call = getattr(follow_up, method_name) method_call = getattr(follow_up, method_name)
if method_call is not None: if method_call is not None:
# extra curl: Coverage report requires parameter details (1|0) # extra curl: Coverage report requires parameter details (1|0)
if coverage_name: if coverage_name:
return method_call(comment_visibility=True).encode(encoding='UTF-8') return method_call(comment_visibility=True)[0].encode(encoding='UTF-8')
elif detail_name: elif detail_name:
return method_call(format='detailed').encode(encoding='UTF-8') return method_call(format='detailed',display_detail = 1)[0].encode(encoding='UTF-8')
else: else:
return method_call().encode(encoding='UTF-8') return method_call()[0].encode(encoding='UTF-8')
if (doc_content.find('${WebPage_')): if (doc_content.find('${WebPage_')):
document_allowed_portal_type_list = ["Project", "Sale Opportunity", "Sale Order"] document_allowed_portal_type_list = ["Project", "Sale Opportunity", "Sale Order"]
......
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