Commit 58950047 authored by Nicolas Wavrant's avatar Nicolas Wavrant

erp5_payroll_l10_fr: no need to re-generate DSN just for changing sending mode

Sending mode is set by user when printing the DSN report
parent 984b5e5a
......@@ -77,7 +77,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/DSNReport_printAsFile</string> </value>
<value> <string>string:${object_url}/DSNReport_viewFilePrintDialog</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -52,7 +52,7 @@ if block_id == 'S10.G00.00':
rubric_value_dict['S10.G00.00.002'] = 'Logiciel maison'
rubric_value_dict['S10.G00.00.003'] = ''
rubric_value_dict['S10.G00.00.004'] = ''
rubric_value_dict['S10.G00.00.005'] = context.getFormat()
rubric_value_dict['S10.G00.00.005'] = '01'
rubric_value_dict['S10.G00.00.006'] = 'P03V01'
rubric_value_dict['S10.G00.00.007'] = '01'
rubric_value_dict['S10.G00.00.008'] = '01'
......
......@@ -2,7 +2,6 @@ from Products.ERP5Type.DateUtils import getNumberOfDayInMonth
if context.getSourceAdministration() is None \
or context.getEffectiveDate() is None \
or context.getFormat() is None \
or context.getQuantity() is None \
or len(context.getAggregateRelatedIdList()) <= 0:
return context.REQUEST.response.redirect("%s?portal_status_message=%s" % (context.absolute_url(), "DSN can't be built if some fields are empty"))
......
......@@ -87,7 +87,6 @@
<value>
<list>
<string>my_effective_date</string>
<string>my_format</string>
<string>my_quantity</string>
<string>my_translated_simulation_state_title</string>
</list>
......
portal = context.getPortalObject()
data = context.getTextContent().decode('utf-8').encode('iso-8859-1')
# Update sending mode "on the fly"
dsn_line_list = data.split('\n')
for line_number, dsn_line in enumerate(dsn_line_list):
if dsn_line.split(',', 1)[0] == 'S10.G00.00.005':
dsn_line_list[line_number] = 'S10.G00.00.005,\'%s\'' % sending_mode
data = '\n'.join(dsn_line_list)
filename = context.getTitle()
RESPONSE.setHeader("Content-Type", "text/plain; charset=iso-8859-1")
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>RESPONSE=None</string> </value>
<value> <string>sending_mode=\'01\', RESPONSE=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>DSNReport_printAsFile</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>your_sending_mode</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DSNReport_viewFilePrintDialog</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>DSNReport_viewFilePrintDialog</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_dialog</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Print DSN</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -10,13 +10,14 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>items</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_format</string> </value>
<value> <string>your_sending_mode</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -56,6 +57,16 @@
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
......@@ -65,15 +76,21 @@
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
<value> <string>my_list_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>DSN try code</string> </value>
<value> <string>Sending Mode</string> </value>
</item>
</dictionary>
</value>
......@@ -81,4 +98,17 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: ((\'Test\', \'01\'), (\'Real\', \'02\'))</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