Commit 92b8f53c authored by Nicolas Wavrant's avatar Nicolas Wavrant

erp5_corporate_identity: allow easy customization of variables used in Letter's template

parent af0e049c
......@@ -76,6 +76,7 @@ else:
# cut corner to retrieve path to css files
letter_version = "001"
letter_reference = letter.getReference()
extra_template_kw = letter.Letter_getExtraTemplateVariableDict()
# overrides for tests
if override_batch_mode:
......@@ -157,7 +158,8 @@ if letter_format == "html":
letter_source_website=letter_source.get("website", blank),
letter_source_bank=letter_source.get("bank", blank),
letter_source_bic=letter_source.get("bic", blank),
letter_source_iban=letter_source.get("iban", blank)
letter_source_iban=letter_source.get("iban", blank),
**extra_template_kw
)
return letter.Base_finishWebPageCreation(
doc_download=letter_download,
......@@ -186,7 +188,8 @@ if letter_format == "pdf":
letter_theme_logo_url=letter.Base_setUrl(path=letter_source.get("enhanced_logo_url"), display=None),
letter_theme_logo_alt=letter_theme.get("theme_logo_description"),
letter_timestamp=letter_modification_date.strftime('%Y-%m-%d'),
letter_source_city=letter_source.get("city", blank)
letter_source_city=letter_source.get("city", blank),
**extra_template_kw
)
letter_content = letter.Letter_createLetterContent(
......@@ -212,7 +215,8 @@ if letter_format == "pdf":
letter_source_city=letter_source.get("city", blank),
letter_source_country_code=letter_source.get("codification", blank),
letter_display_source_adress=letter_display_source_adress,
letter_content = letter_content
letter_content = letter_content,
**extra_template_kw
)
letter_foot = letter.Letter_createLetterFooter(
......@@ -241,6 +245,7 @@ if letter_format == "pdf":
letter_source_bank=letter_source.get("bank", blank),
letter_source_bic=letter_source.get("bic", blank),
letter_source_iban=letter_source.get("iban", blank),
**extra_template_kw
)
# ================ encode and build cloudoo elements =========================
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Letter_getExtraTemplateVariableDict</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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