Commit 50cf125a authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_corporate_identity: add new parameter to get document after save

parent 376ccfd9
...@@ -51,6 +51,7 @@ doc = context ...@@ -51,6 +51,7 @@ doc = context
doc_prefix = pref.getPreferredCorporateIdentityTemplateReportDocumentPrefix() or "Report." doc_prefix = pref.getPreferredCorporateIdentityTemplateReportDocumentPrefix() or "Report."
doc_download = None #XXX not yet implemented doc_download = None #XXX not yet implemented
doc_save = int(kw.get('document_save') or 0) doc_save = int(kw.get('document_save') or 0)
get_doc_after_save = int(kw.get('get_doc_after_save') or 0)
doc_display_header = int(kw.get('display_header') or 0) doc_display_header = int(kw.get('display_header') or 0)
doc_display_comment = int(kw.get('display_comment') or 0) doc_display_comment = int(kw.get('display_comment') or 0)
doc_display_detail = int(kw.get('display_detail') or 0) doc_display_detail = int(kw.get('display_detail') or 0)
...@@ -279,6 +280,7 @@ if doc_format == "pdf": ...@@ -279,6 +280,7 @@ if doc_format == "pdf":
return doc.WebPage_finishPdfCreation( return doc.WebPage_finishPdfCreation(
doc_download=doc_download, doc_download=doc_download,
doc_save=doc_save, doc_save=doc_save,
get_doc_after_save = get_doc_after_save,
doc_version=override_document_version or doc_version or "001", doc_version=override_document_version or doc_version or "001",
doc_title=doc_title, doc_title=doc_title,
doc_aggregate_list=doc_aggregate_list, doc_aggregate_list=doc_aggregate_list,
......
...@@ -19,7 +19,7 @@ Save, download or return generated PDF Document ...@@ -19,7 +19,7 @@ Save, download or return generated PDF Document
from io import BytesIO from io import BytesIO
if doc_save: if doc_save or get_doc_after_save:
dms_module = getattr(context, 'document_module', None) dms_module = getattr(context, 'document_module', None)
if dms_module is not None: if dms_module is not None:
document = dms_module.newContent( document = dms_module.newContent(
...@@ -56,6 +56,8 @@ if doc_save: ...@@ -56,6 +56,8 @@ if doc_save:
# XXX redirect = true? # XXX redirect = true?
if context.getWebSiteValue(): if context.getWebSiteValue():
context.getPortalObject().portal_skins.changeSkin('HalRestricted') context.getPortalObject().portal_skins.changeSkin('HalRestricted')
if get_doc_after_save:
return document
return document.Base_redirect(form_id='view', return document.Base_redirect(form_id='view',
keep_items=dict(portal_status_message=message) keep_items=dict(portal_status_message=message)
) )
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>doc_download=None, doc_aggregate_list=None, doc_title=None, doc_save=None, doc_version=None, doc_relative_url=None, doc_language=None, doc_modification_date=None, doc_reference=None, doc_full_reference=None, doc_pdf_file=None</string> </value> <value> <string>doc_download=None, doc_aggregate_list=None, doc_title=None, doc_save=None, doc_version=None, doc_relative_url=None, doc_language=None, doc_modification_date=None, doc_reference=None, doc_full_reference=None, doc_pdf_file=None, get_doc_after_save = None</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
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