Commit 34d50a78 authored by Jérome Perrin's avatar Jérome Perrin

Enable coding style on erp5_payroll

See merge request nexedi/erp5!1637
parents e83e7960 12672876
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>string:${object_url}/RatioSettings_view</string> </value> <value> <string>string:${object_url}/PaySheetModelRatioLine_view</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>string:${object_url}/PaySheet_viewODTPrintDialog</string> </value> <value> <string>string:${object_url}/PaySheetTransaction_viewODTPrintDialog</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -66,7 +66,7 @@ class PaySheetModelLine(TradeModelLine): ...@@ -66,7 +66,7 @@ class PaySheetModelLine(TradeModelLine):
security.declareProtected(Permissions.ModifyPortalContent, security.declareProtected(Permissions.ModifyPortalContent,
'newCellContent' ) 'newCellContent' )
def newCellContent(self, id, portal_type='Pay Sheet Model Cell', **kw): def newCellContent(self, id, portal_type='Pay Sheet Model Cell', **kw): # pylint:disable=redefined-builtin
"""Overriden to specify default portal type """Overriden to specify default portal type
""" """
return self.newContent(id=id, portal_type=portal_type, **kw) return self.newContent(id=id, portal_type=portal_type, **kw)
...@@ -37,9 +37,7 @@ ...@@ -37,9 +37,7 @@
<item> <item>
<key> <string>text_content_warning_message</string> </key> <key> <string>text_content_warning_message</string> </key>
<value> <value>
<tuple> <tuple/>
<string>W: 69, 27: Redefining built-in \'id\' (redefined-builtin)</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
......
...@@ -10,9 +10,6 @@ ...@@ -10,9 +10,6 @@
<role>Author</role> <role>Author</role>
<role>Manager</role> <role>Manager</role>
</permission> </permission>
<permission type='tuple'>
<name>Add ERP5TioSafe Tools</name>
</permission>
<permission type='tuple'> <permission type='tuple'>
<name>Add portal content</name> <name>Add portal content</name>
<role>Assignor</role> <role>Assignor</role>
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
</item> </item>
<item> <item>
<key> <string>init_script</string> </key> <key> <string>init_script</string> </key>
<value> <string>PaySheetModeLine_init</string> </value> <value> <string>PaySheetModelLine_init</string> </value>
</item> </item>
<item> <item>
<key> <string>permission</string> </key> <key> <string>permission</string> </key>
......
...@@ -3,7 +3,6 @@ from DateTime import DateTime ...@@ -3,7 +3,6 @@ from DateTime import DateTime
request = context.REQUEST request = context.REQUEST
portal = context.getPortalObject() portal = context.getPortalObject()
translateString = portal.Base_translateString
net_salary_base_amount_uid = \ net_salary_base_amount_uid = \
portal.portal_categories.base_amount.payroll.report.salary.net.getUid() portal.portal_categories.base_amount.payroll.report.salary.net.getUid()
......
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>required</string>
<string>editable</string>
<string>default</string> <string>default</string>
<string>editable</string>
<string>items</string> <string>items</string>
<string>required</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -86,6 +86,10 @@ ...@@ -86,6 +86,10 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>editable</string> </key> <key> <string>editable</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
...@@ -98,6 +102,12 @@ ...@@ -98,6 +102,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value> <value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>required</string> </key> <key> <string>required</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
......
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>required</string>
<string>editable</string>
<string>default</string> <string>default</string>
<string>editable</string>
<string>items</string> <string>items</string>
<string>required</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -86,6 +86,12 @@ ...@@ -86,6 +86,12 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>editable</string> </key> <key> <string>editable</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
...@@ -98,6 +104,12 @@ ...@@ -98,6 +104,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value> <value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>required</string> </key> <key> <string>required</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>default</string>
<string>required</string> <string>required</string>
<string>title</string> <string>title</string>
<string>default</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -79,6 +79,12 @@ ...@@ -79,6 +79,12 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_date</string> </value> <value> <string>my_date</string> </value>
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>default</string> <string>default</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -78,6 +78,12 @@ ...@@ -78,6 +78,12 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_date</string> </value> <value> <string>my_date</string> </value>
......
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>default</string>
<string>description</string> <string>description</string>
<string>title</string> <string>items</string>
<string>required</string> <string>required</string>
<string>size</string> <string>size</string>
<string>default</string> <string>title</string>
<string>items</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -94,6 +94,12 @@ ...@@ -94,6 +94,12 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>Only consider transactions in those states.</string> </value> <value> <string>Only consider transactions in those states.</string> </value>
...@@ -106,6 +112,12 @@ ...@@ -106,6 +112,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value> <value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>required</string> </key> <key> <string>required</string> </key>
<value> <int>1</int> </value> <value> <int>1</int> </value>
......
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>required</string>
<string>editable</string>
<string>default</string> <string>default</string>
<string>editable</string>
<string>items</string> <string>items</string>
<string>required</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -86,6 +86,10 @@ ...@@ -86,6 +86,10 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>editable</string> </key> <key> <string>editable</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
...@@ -98,6 +102,12 @@ ...@@ -98,6 +102,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value> <value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>required</string> </key> <key> <string>required</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
......
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>required</string>
<string>editable</string>
<string>default</string> <string>default</string>
<string>editable</string>
<string>items</string> <string>items</string>
<string>required</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -86,6 +86,12 @@ ...@@ -86,6 +86,12 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>editable</string> </key> <key> <string>editable</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
...@@ -98,6 +104,12 @@ ...@@ -98,6 +104,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value> <value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>required</string> </key> <key> <string>required</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>default</string>
<string>required</string> <string>required</string>
<string>title</string> <string>title</string>
<string>default</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -79,6 +79,12 @@ ...@@ -79,6 +79,12 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_date</string> </value> <value> <string>my_date</string> </value>
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>default</string> <string>default</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -78,6 +78,12 @@ ...@@ -78,6 +78,12 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_date</string> </value> <value> <string>my_date</string> </value>
......
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>default</string>
<string>description</string> <string>description</string>
<string>title</string> <string>items</string>
<string>required</string> <string>required</string>
<string>size</string> <string>size</string>
<string>default</string> <string>title</string>
<string>items</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -94,6 +94,12 @@ ...@@ -94,6 +94,12 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>Only consider transactions in those states.</string> </value> <value> <string>Only consider transactions in those states.</string> </value>
...@@ -106,6 +112,12 @@ ...@@ -106,6 +112,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value> <value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>required</string> </key> <key> <string>required</string> </key>
<value> <int>1</int> </value> <value> <int>1</int> </value>
......
...@@ -62,7 +62,7 @@ AAA=</string> </value> ...@@ -62,7 +62,7 @@ AAA=</string> </value>
</item> </item>
<item> <item>
<key> <string>ooo_stylesheet</string> </key> <key> <string>ooo_stylesheet</string> </key>
<value> <string>PaySheet_getODTStyleSheet</string> </value> <value> <string>PaySheetTransaction_getODTStyleSheet</string> </value>
</item> </item>
<item> <item>
<key> <string>ooo_xml_file_id</string> </key> <key> <string>ooo_xml_file_id</string> </key>
......
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>description</string>
<string>title</string>
<string>default</string> <string>default</string>
<string>description</string>
<string>items</string> <string>items</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -86,6 +86,10 @@ ...@@ -86,6 +86,10 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>Printing format</string> </value> <value> <string>Printing format</string> </value>
...@@ -98,6 +102,12 @@ ...@@ -98,6 +102,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value> <value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
<value> <value>
<list> <list>
<string>description</string> <string>description</string>
<string>title</string>
<string>items</string> <string>items</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -91,6 +91,12 @@ ...@@ -91,6 +91,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value> <value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>description</string>
<string>title</string>
<string>css_class</string> <string>css_class</string>
<string>input_style</string> <string>description</string>
<string>display_width</string> <string>display_width</string>
<string>input_style</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -89,6 +89,10 @@ ...@@ -89,6 +89,10 @@
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>The price paid for the one unit of quantity</string> </value> <value> <string>The price paid for the one unit of quantity</string> </value>
</item> </item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_float_field</string> </value> <value> <string>my_float_field</string> </value>
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
<value> <value>
<list> <list>
<string>description</string> <string>description</string>
<string>title</string>
<string>items</string> <string>items</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -91,6 +91,12 @@ ...@@ -91,6 +91,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value> <value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>description</string>
<string>title</string>
<string>css_class</string> <string>css_class</string>
<string>input_style</string> <string>description</string>
<string>display_width</string> <string>display_width</string>
<string>input_style</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -89,6 +89,10 @@ ...@@ -89,6 +89,10 @@
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>The Ratio applied to the Base.</string> </value> <value> <string>The Ratio applied to the Base.</string> </value>
</item> </item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_float_field</string> </value> <value> <string>my_float_field</string> </value>
......
...@@ -14,20 +14,20 @@ if resource is not None: ...@@ -14,20 +14,20 @@ if resource is not None:
for v in base_application_variation_dict.values(): for v in base_application_variation_dict.values():
if matrixbox == 1: if matrixbox == 1:
cell_range.append(map(lambda x: (x[1],x[0]), v)) cell_range.append([(y, x) for x, y in v])
else: else:
cell_range.append(v) cell_range.append(v)
else: else:
if matrixbox == 1: if matrixbox == 1:
# XXX matrixbox is right_display (not as listfield) => invert display and value in item # XXX matrixbox is right_display (not as listfield) => invert display and value in item
if context.getVariationCategoryList(base_category_list=(base_category,)): if context.getVariationCategoryList(base_category_list=(base_category,)):
cell_range.append(map(lambda x: (x[1],x[0]), cell_range.append([(y, x) for x, y in
context.getVariationCategoryItemList(base_category_list=\ context.getVariationCategoryItemList(base_category_list=\
(base_category,) ) ) ) (base_category,) )])
else: else:
cell_range.append(context.getVariationCategoryList(base_category_list=\ cell_range.append(context.getVariationCategoryList(base_category_list=\
(base_category,))) (base_category,)))
cell_range = filter(lambda x: x != [], cell_range ) cell_range = [x for x in cell_range if x]
return cell_range return cell_range
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
<value> <value>
<list> <list>
<string>description</string> <string>description</string>
<string>title</string>
<string>items</string> <string>items</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -91,6 +91,12 @@ ...@@ -91,6 +91,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value> <value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>description</string>
<string>title</string>
<string>css_class</string> <string>css_class</string>
<string>input_style</string>
<string>default</string> <string>default</string>
<string>description</string>
<string>display_width</string> <string>display_width</string>
<string>input_style</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -92,10 +92,18 @@ ...@@ -92,10 +92,18 @@
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string>figure</string> </value> <value> <string>figure</string> </value>
</item> </item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>The Ratio applied to the Base.</string> </value> <value> <string>The Ratio applied to the Base.</string> </value>
</item> </item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_float_field</string> </value> <value> <string>my_float_field</string> </value>
......
...@@ -10,13 +10,13 @@ ...@@ -10,13 +10,13 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>description</string>
<string>title</string>
<string>css_class</string> <string>css_class</string>
<string>input_style</string>
<string>default</string> <string>default</string>
<string>description</string>
<string>display_width</string> <string>display_width</string>
<string>input_style</string>
<string>precision</string> <string>precision</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -99,10 +99,18 @@ ...@@ -99,10 +99,18 @@
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string>figure</string> </value> <value> <string>figure</string> </value>
</item> </item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>The Base used to calculate the tax.</string> </value> <value> <string>The Base used to calculate the tax.</string> </value>
</item> </item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_float_field</string> </value> <value> <string>my_float_field</string> </value>
...@@ -115,6 +123,10 @@ ...@@ -115,6 +123,10 @@
<key> <string>input_style</string> </key> <key> <string>input_style</string> </key>
<value> <string>-1 234.5</string> </value> <value> <string>-1 234.5</string> </value>
</item> </item>
<item>
<key> <string>precision</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -10,13 +10,13 @@ ...@@ -10,13 +10,13 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>css_class</string> <string>css_class</string>
<string>editable</string>
<string>input_style</string>
<string>default</string> <string>default</string>
<string>display_width</string> <string>display_width</string>
<string>editable</string>
<string>input_style</string>
<string>precision</string> <string>precision</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -99,6 +99,14 @@ ...@@ -99,6 +99,14 @@
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string>figure</string> </value> <value> <string>figure</string> </value>
</item> </item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item> <item>
<key> <string>editable</string> </key> <key> <string>editable</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
...@@ -115,6 +123,10 @@ ...@@ -115,6 +123,10 @@
<key> <string>input_style</string> </key> <key> <string>input_style</string> </key>
<value> <string>-1 234.5</string> </value> <value> <string>-1 234.5</string> </value>
</item> </item>
<item>
<key> <string>precision</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>hidden</string>
<string>default</string> <string>default</string>
<string>hidden</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -79,6 +79,12 @@ ...@@ -79,6 +79,12 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_lines_field</string> </value> <value> <string>my_lines_field</string> </value>
......
...@@ -50,7 +50,7 @@ if matrixbox : ...@@ -50,7 +50,7 @@ if matrixbox :
% script.id) % script.id)
cell_range.append(category_cell_range) cell_range.append(category_cell_range)
cell_range = filter(lambda x: x != [], cell_range) cell_range = [x for x in cell_range if x]
while len(cell_range) < 3: while len(cell_range) < 3:
cell_range.append([]) cell_range.append([])
return cell_range return cell_range
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>PaySheetModeLine_init</string> </value> <value> <string>PaySheetModelLine_init</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>hidden</string>
<string>default</string> <string>default</string>
<string>hidden</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -79,6 +79,12 @@ ...@@ -79,6 +79,12 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_lines_field</string> </value> <value> <string>my_lines_field</string> </value>
......
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>description</string>
<string>title</string>
<string>css_class</string> <string>css_class</string>
<string>input_style</string>
<string>default</string> <string>default</string>
<string>description</string>
<string>display_width</string> <string>display_width</string>
<string>input_style</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -92,10 +92,18 @@ ...@@ -92,10 +92,18 @@
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string>figure</string> </value> <value> <string>figure</string> </value>
</item> </item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>The Ratio applied to the Base.</string> </value> <value> <string>The Ratio applied to the Base.</string> </value>
</item> </item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_float_field</string> </value> <value> <string>my_float_field</string> </value>
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>hidden</string>
<string>default</string> <string>default</string>
<string>hidden</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -79,6 +79,12 @@ ...@@ -79,6 +79,12 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_lines_field</string> </value> <value> <string>my_lines_field</string> </value>
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>display_width</string>
<string>default</string> <string>default</string>
<string>display_width</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -79,6 +79,10 @@ ...@@ -79,6 +79,10 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>display_width</string> </key> <key> <string>display_width</string> </key>
<value> <int>20</int> </value> <value> <int>20</int> </value>
......
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>RatioSettings_view</string> </value> <value> <string>PaySheetModelRatioLine_view</string> </value>
</item> </item>
<item> <item>
<key> <string>method</string> </key> <key> <string>method</string> </key>
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
<value> <value>
<list> <list>
<string>description</string> <string>description</string>
<string>title</string>
<string>enabled</string> <string>enabled</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -83,6 +83,10 @@ ...@@ -83,6 +83,10 @@
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>The absolute date at which payment is expected to be made.</string> </value> <value> <string>The absolute date at which payment is expected to be made.</string> </value>
</item> </item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_date</string> </value> <value> <string>my_date</string> </value>
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>items</string> <string>items</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -86,6 +86,12 @@ ...@@ -86,6 +86,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value> <value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>items</string> <string>items</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -86,6 +86,12 @@ ...@@ -86,6 +86,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value> <value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
<value> <value>
<list> <list>
<string>description</string> <string>description</string>
<string>title</string>
<string>items</string> <string>items</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -91,6 +91,12 @@ ...@@ -91,6 +91,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value> <value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
<value> <value>
<list> <list>
<string>cell_portal_type</string> <string>cell_portal_type</string>
<string>columns</string>
<string>editable_attributes</string> <string>editable_attributes</string>
<string>lines</string>
<string>title</string> <string>title</string>
<string>update_cell_range</string> <string>update_cell_range</string>
<string>lines</string>
<string>columns</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -92,6 +92,12 @@ ...@@ -92,6 +92,12 @@
<key> <string>cell_portal_type</string> </key> <key> <string>cell_portal_type</string> </key>
<value> <string>Pay Sheet Model Slice</string> </value> <value> <string>Pay Sheet Model Slice</string> </value>
</item> </item>
<item>
<key> <string>columns</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>editable_attributes</string> </key> <key> <string>editable_attributes</string> </key>
<value> <value>
...@@ -115,6 +121,12 @@ ...@@ -115,6 +121,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value> <value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>lines</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>hidden</string>
<string>default</string> <string>default</string>
<string>hidden</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -79,6 +79,12 @@ ...@@ -79,6 +79,12 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_lines_field</string> </value> <value> <string>my_lines_field</string> </value>
......
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>css_class</string> <string>css_class</string>
<string>input_style</string>
<string>default</string> <string>default</string>
<string>display_width</string> <string>display_width</string>
<string>input_style</string>
<string>precision</string> <string>precision</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -98,6 +98,14 @@ ...@@ -98,6 +98,14 @@
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string>figure</string> </value> <value> <string>figure</string> </value>
</item> </item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_float_field</string> </value> <value> <string>my_float_field</string> </value>
...@@ -110,6 +118,10 @@ ...@@ -110,6 +118,10 @@
<key> <string>input_style</string> </key> <key> <string>input_style</string> </key>
<value> <string>-1 234.5</string> </value> <value> <string>-1 234.5</string> </value>
</item> </item>
<item>
<key> <string>precision</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>css_class</string> <string>css_class</string>
<string>input_style</string>
<string>default</string> <string>default</string>
<string>display_width</string> <string>display_width</string>
<string>input_style</string>
<string>precision</string> <string>precision</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -98,6 +98,14 @@ ...@@ -98,6 +98,14 @@
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string>figure</string> </value> <value> <string>figure</string> </value>
</item> </item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_float_field</string> </value> <value> <string>my_float_field</string> </value>
...@@ -110,6 +118,10 @@ ...@@ -110,6 +118,10 @@
<key> <string>input_style</string> </key> <key> <string>input_style</string> </key>
<value> <string>-1 234.5</string> </value> <value> <string>-1 234.5</string> </value>
</item> </item>
<item>
<key> <string>precision</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>hidden</string>
<string>default</string> <string>default</string>
<string>hidden</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -79,6 +79,12 @@ ...@@ -79,6 +79,12 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_lines_field</string> </value> <value> <string>my_lines_field</string> </value>
......
...@@ -30,7 +30,6 @@ if not employer: ...@@ -30,7 +30,6 @@ if not employer:
if not quantity_unit: if not quantity_unit:
return redirect('The work duration unit must be defined') return redirect('The work duration unit must be defined')
employer_obj = paysheet.getDestinationSectionValue()
employee_obj = paysheet.getSourceSectionValue() employee_obj = paysheet.getSourceSectionValue()
if not employee_obj.getCareerGrade(): if not employee_obj.getCareerGrade():
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>portal_type_list=[], property_list=()</string> </value> <value> <string>portal_type_list=(), property_list=()</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
this script is the conductor. All other scripts that permit to create a this script is the conductor. All other scripts that permit to create a
paysheet are called here paysheet are called here
''' '''
import pprint
# Delete all objects in the paysheet # Delete all objects in the paysheet
id_list = [] id_list = []
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>listbox=[], **kw</string> </value> <value> <string>listbox=(), **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
""" """
from Products.ERP5Type.Utils import cartesianProduct from Products.ERP5Type.Utils import cartesianProduct
import pprint
from Products.ERP5Type.Message import translateString from Products.ERP5Type.Message import translateString
def sortByIntIndex(a, b): def sortByIntIndex(a, b):
...@@ -24,7 +23,7 @@ model_line_list = [x.getObject() for x in model_line_list \ ...@@ -24,7 +23,7 @@ model_line_list = [x.getObject() for x in model_line_list \
line_list = [] line_list = []
object_dict_list = [] object_dict_list = []
id = 0 id_ = 0
for model_line in model_line_list: for model_line in model_line_list:
base_category_list = model_line.getVariationBaseCategoryList() base_category_list = model_line.getVariationBaseCategoryList()
...@@ -33,24 +32,19 @@ for model_line in model_line_list: ...@@ -33,24 +32,19 @@ for model_line in model_line_list:
base_application_list = ', '.join(translated_base_application_list) base_application_list = ', '.join(translated_base_application_list)
list_of_list = [] list_of_list = []
for base_category in base_category_list: for base_category in base_category_list:
list = model_line.getVariationCategoryList(base_category_list=\ list_of_list.append(model_line.getVariationCategoryList(base_category_list=\
base_category) base_category))
list_of_list.append(list)
cartesian_product = cartesianProduct(list_of_list) cartesian_product = cartesianProduct(list_of_list)
previous_share = None
object_dict = {} object_dict = {}
if cartesian_product == [[]]: if cartesian_product == [[]]:
share_dict = {} share_dict = {}
if 0:
share_dict[cell.getContributionShare()+'_price'] = 0
share_dict[cell.getContributionShare()+'_quantity'] = 0
continue continue
for tuple in cartesian_product: for tuple_ in cartesian_product:
share_dict = {} share_dict = {}
cell = model_line.getCell(*tuple) cell = model_line.getCell(*tuple_)
if cell is None: if cell is None:
continue continue
...@@ -71,7 +65,7 @@ for model_line in model_line_list: ...@@ -71,7 +65,7 @@ for model_line in model_line_list:
share_dict[cell.getContributionShare()+'_quantity'] = quantity share_dict[cell.getContributionShare()+'_quantity'] = quantity
tuple_dict = {} tuple_dict = {}
for item in tuple: for item in tuple_:
# the dict key is the base category and value is the category path # the dict key is the base category and value is the category path
tuple_dict[item.split('/')[0]]=context.portal_categories.restrictedTraverse(item).getTitle() tuple_dict[item.split('/')[0]]=context.portal_categories.restrictedTraverse(item).getTitle()
tuple_dict[item.split('/')[0]+'_relative_url']=item tuple_dict[item.split('/')[0]+'_relative_url']=item
...@@ -92,8 +86,8 @@ for model_line in model_line_list: ...@@ -92,8 +86,8 @@ for model_line in model_line_list:
if tuple_dict.has_key('salary_range'): if tuple_dict.has_key('salary_range'):
salary_range_title = tuple_dict['salary_range'] salary_range_title = tuple_dict['salary_range']
salary_range_relative_url = tuple_dict['salary_range_relative_url'] salary_range_relative_url = tuple_dict['salary_range_relative_url']
new_uid = "new_%s" % id new_uid = "new_%s" % id_
id += 1 id_ += 1
object_dict[salary_range]={ object_dict[salary_range]={
'uid':new_uid, 'uid':new_uid,
'salary_range_title':salary_range_title, 'salary_range_title':salary_range_title,
...@@ -139,14 +133,14 @@ def sortByIntIndexDescending(x, y): ...@@ -139,14 +133,14 @@ def sortByIntIndexDescending(x, y):
sortByDefaultSortMethod = sortByIntIndexAscending sortByDefaultSortMethod = sortByIntIndexAscending
if kw.has_key('sort_on'): if kw.has_key('sort_on'):
list = kw['sort_on'] sort_on = kw['sort_on']
if list[0][0] == 'title' and list[0][1]=='ascending': if sort_on[0][0] == 'title' and sort_on[0][1]=='ascending':
line_list.sort(sortByTitleAscending) line_list.sort(sortByTitleAscending)
elif list[0][0] == 'title' and list[0][1]=='descending': elif sort_on[0][0] == 'title' and sort_on[0][1]=='descending':
line_list.sort(sortByTitleDescending) line_list.sort(sortByTitleDescending)
elif list[0][0] == 'int_index' and list[0][1]=='ascending': elif sort_on[0][0] == 'int_index' and sort_on[0][1]=='ascending':
line_list.sort(sortByIntIndexAscending) line_list.sort(sortByIntIndexAscending)
elif list[0][0] == 'int_index' and list[0][1]=='descending': elif sort_on[0][0] == 'int_index' and sort_on[0][1]=='descending':
line_list.sort(sortByIntIndexDescending) line_list.sort(sortByIntIndexDescending)
else: else:
line_list.sort(sortByDefaultSortMethod) line_list.sort(sortByDefaultSortMethod)
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
line_list = context.PaySheetTransaction_getMovementList(sort_on=[('int_index', line_list = context.PaySheetTransaction_getMovementList(sort_on=[('int_index',
'ascending')]) 'ascending')])
def addProperties(line, line_dict, property_list): def addProperties(line, line_dict, property_list):
for property in property_list: for prop in property_list:
line_dict[property] = getattr(line, property, None) line_dict[prop] = getattr(line, prop, None)
return line_dict return line_dict
line_dict_list = [] line_dict_list = []
......
...@@ -7,10 +7,9 @@ ...@@ -7,10 +7,9 @@
from Products.ERP5Type.Utils import cartesianProduct from Products.ERP5Type.Utils import cartesianProduct
import pprint
from Products.ERP5Type.Message import translateString from Products.ERP5Type.Message import translateString
portal = context.getPortalObject(); portal = context.getPortalObject()
paysheet_line_list = context.contentValues(portal_type=('Pay Sheet Line', 'Pay Sheet Model Line')) paysheet_line_list = context.contentValues(portal_type=('Pay Sheet Line', 'Pay Sheet Model Line'))
if context.getPriceCurrencyValue() is not None: if context.getPriceCurrencyValue() is not None:
precision = context.getPriceCurrencyValue().getQuantityPrecision() precision = context.getPriceCurrencyValue().getQuantityPrecision()
...@@ -35,14 +34,11 @@ for paysheet_line in paysheet_line_list: ...@@ -35,14 +34,11 @@ for paysheet_line in paysheet_line_list:
list_of_list = [] list_of_list = []
for base_category in base_category_list: for base_category in base_category_list:
list = paysheet_line.getVariationCategoryList(base_category_list=\ list_of_list.append(
base_category) paysheet_line.getVariationCategoryList(base_category_list=\
list_of_list.append(list) base_category))
cartesian_product = cartesianProduct(list_of_list) cartesian_product = cartesianProduct(list_of_list)
previous_share = None
indice = 0
if cartesian_product == [[]] or cartesian_product == []: if cartesian_product == [[]] or cartesian_product == []:
params = { params = {
'base':paysheet_line.getTotalPrice(), 'base':paysheet_line.getTotalPrice(),
...@@ -56,7 +52,6 @@ for paysheet_line in paysheet_line_list: ...@@ -56,7 +52,6 @@ for paysheet_line in paysheet_line_list:
object_dict = {} object_dict = {}
for product in cartesian_product: for product in cartesian_product:
indice += 1
share_dict = {} share_dict = {}
cell = paysheet_line.getCell(base_id='movement', *product) cell = paysheet_line.getCell(base_id='movement', *product)
if cell is None: if cell is None:
...@@ -80,14 +75,14 @@ for paysheet_line in paysheet_line_list: ...@@ -80,14 +75,14 @@ for paysheet_line in paysheet_line_list:
# we want to display as lines as a paysheet line as slices # we want to display as lines as a paysheet line as slices
# this is easier to read # this is easier to read
slice = cell.getSalaryRange() salary_range_slice = cell.getSalaryRange()
if slice is None: if salary_range_slice is None:
slice = 'no_slice' salary_range_slice = 'no_slice'
if not object_dict.has_key(slice): if not object_dict.has_key(salary_range_slice):
slice_title = None slice_title = None
if tuple_dict.has_key('salary_range'): if tuple_dict.has_key('salary_range'):
slice_title=tuple_dict['salary_range'] slice_title=tuple_dict['salary_range']
object_dict[slice]={ object_dict[salary_range_slice]={
'slice':slice_title, 'slice':slice_title,
'base_name':base_name, 'base_name':base_name,
'base':base, 'base':base,
...@@ -96,9 +91,9 @@ for paysheet_line in paysheet_line_list: ...@@ -96,9 +91,9 @@ for paysheet_line in paysheet_line_list:
'service': service is not None and\ 'service': service is not None and\
service.getId() or '', service.getId() or '',
'causality': causality,} 'causality': causality,}
object_dict[slice].update(share_dict) object_dict[salary_range_slice].update(share_dict)
else: else:
object_dict[slice].update(**share_dict) object_dict[salary_range_slice].update(**share_dict)
if not object_dict: if not object_dict:
# when the variation categories are set, but no cells. # when the variation categories are set, but no cells.
...@@ -120,8 +115,6 @@ for paysheet_line in paysheet_line_list: ...@@ -120,8 +115,6 @@ for paysheet_line in paysheet_line_list:
line_list.append(paysheet_line.asContext(**params)) line_list.append(paysheet_line.asContext(**params))
continue continue
# print pprint.pformat(object_dict)
for object_key in paysheet_line.getSalaryRangeList(): for object_key in paysheet_line.getSalaryRangeList():
line_list.append(paysheet_line.asContext(**object_dict[object_key])) line_list.append(paysheet_line.asContext(**object_dict[object_key]))
if object_dict.has_key('no_slice'): if object_dict.has_key('no_slice'):
...@@ -145,14 +138,14 @@ def sortByIntIndexDescending(x, y): ...@@ -145,14 +138,14 @@ def sortByIntIndexDescending(x, y):
sortByDefaultSortMethod = sortByIntIndexAscending sortByDefaultSortMethod = sortByIntIndexAscending
if kw.has_key('sort_on'): if kw.has_key('sort_on'):
list = kw['sort_on'] sort_on = kw['sort_on']
if list[0][0] == 'title' and list[0][1]=='ascending': if sort_on[0][0] == 'title' and sort_on[0][1]=='ascending':
line_list.sort(sortByTitleAscending) line_list.sort(sortByTitleAscending)
elif list[0][0] == 'title' and list[0][1]=='descending': elif sort_on[0][0] == 'title' and sort_on[0][1]=='descending':
line_list.sort(sortByTitleDescending) line_list.sort(sortByTitleDescending)
elif list[0][0] == 'int_index' and list[0][1]=='ascending': elif sort_on[0][0] == 'int_index' and sort_on[0][1]=='ascending':
line_list.sort(sortByIntIndexAscending) line_list.sort(sortByIntIndexAscending)
elif list[0][0] == 'int_index' and list[0][1]=='descending': elif sort_on[0][0] == 'int_index' and sort_on[0][1]=='descending':
line_list.sort(sortByIntIndexDescending) line_list.sort(sortByIntIndexDescending)
else: else:
line_list.sort(sortByDefaultSortMethod) line_list.sort(sortByDefaultSortMethod)
......
translateString = context.Base_translateString translateString = context.Base_translateString
specialise_value = context.getSpecialiseValue()
def getFieldAsString(field): def getFieldAsString(field):
...@@ -12,14 +11,6 @@ def getFieldAsLineList(field): ...@@ -12,14 +11,6 @@ def getFieldAsLineList(field):
text_list = text.split('\n') text_list = text.split('\n')
return [x for x in text_list if x] return [x for x in text_list if x]
def getProductAndLineDesc(prod_desc, line_desc):
line_list = []
if line_desc:
line_list.extend(getFieldAsLineList(line_desc))
elif prod_desc:
line_list.extend(getFieldAsLineList(prod_desc))
return line_list
def getOneLineAddress(text, region): def getOneLineAddress(text, region):
text_list = [getFieldAsString(text)] text_list = [getFieldAsString(text)]
if region: if region:
...@@ -117,7 +108,6 @@ def getSocialOrganisationValue(): ...@@ -117,7 +108,6 @@ def getSocialOrganisationValue():
line_list = [] line_list = []
total_price = 0.0 total_price = 0.0
total_vat = 0.0
def unicodeDict(d): def unicodeDict(d):
for k, v in d.items(): for k, v in d.items():
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
<value> <string>PaySheet_getODTStyleSheet</string> </value> <value> <string>PaySheetTransaction_getODTStyleSheet</string> </value>
</item> </item>
<item> <item>
<key> <string>content_type</string> </key> <key> <string>content_type</string> </key>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# are not in stock table due to the lack of source/destination definition # are not in stock table due to the lack of source/destination definition
if paysheet is None: if paysheet is None:
paysheet = context paysheet = context
# test the list parameters # test the list parameters
if base_contribution_list is None: if base_contribution_list is None:
...@@ -17,7 +17,7 @@ elif not (same_type(base_contribution_list, []) or ...@@ -17,7 +17,7 @@ elif not (same_type(base_contribution_list, []) or
same_type(base_contribution_list, ())): same_type(base_contribution_list, ())):
base_contribution_list = [base_contribution_list] base_contribution_list = [base_contribution_list]
portal = context.getPortalObject(); portal = context.getPortalObject()
portal_simulation = portal.portal_simulation portal_simulation = portal.portal_simulation
base_amount = portal.portal_categories.base_amount base_amount = portal.portal_categories.base_amount
......
# pylint:disable=redefined-builtin
if target_language: if target_language:
container.REQUEST['AcceptLanguage'].set(target_language, 10) container.REQUEST['AcceptLanguage'].set(target_language, 10)
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>PaySheet_printAsODT</string> </value> <value> <string>PaySheetTransaction_printAsODT</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>css_class</string> <string>css_class</string>
<string>display_width</string>
<string>editable</string> <string>editable</string>
<string>input_style</string> <string>input_style</string>
<string>display_width</string>
<string>precision</string> <string>precision</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -92,6 +92,10 @@ ...@@ -92,6 +92,10 @@
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string>figure</string> </value> <value> <string>figure</string> </value>
</item> </item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item> <item>
<key> <string>editable</string> </key> <key> <string>editable</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
...@@ -108,6 +112,10 @@ ...@@ -108,6 +112,10 @@
<key> <string>input_style</string> </key> <key> <string>input_style</string> </key>
<value> <string>-1 234.5</string> </value> <value> <string>-1 234.5</string> </value>
</item> </item>
<item>
<key> <string>precision</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
<value> <value>
<list> <list>
<string>description</string> <string>description</string>
<string>title</string>
<string>enabled</string> <string>enabled</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -83,6 +83,10 @@ ...@@ -83,6 +83,10 @@
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>The absolute date at which payment is expected to be made.</string> </value> <value> <string>The absolute date at which payment is expected to be made.</string> </value>
</item> </item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_date</string> </value> <value> <string>my_date</string> </value>
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>items</string> <string>items</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -86,6 +86,12 @@ ...@@ -86,6 +86,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value> <value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
<value> <value>
<list> <list>
<string>description</string> <string>description</string>
<string>title</string>
<string>items</string> <string>items</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -91,6 +91,12 @@ ...@@ -91,6 +91,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value> <value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -10,15 +10,15 @@ ...@@ -10,15 +10,15 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>stat_columns</string> <string>anchor</string>
<string>editable_columns</string>
<string>stat_method</string>
<string>title</string>
<string>selection_name</string>
<string>columns</string> <string>columns</string>
<string>editable_columns</string>
<string>list_method</string> <string>list_method</string>
<string>anchor</string>
<string>portal_types</string> <string>portal_types</string>
<string>selection_name</string>
<string>stat_columns</string>
<string>stat_method</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -155,6 +155,12 @@ ...@@ -155,6 +155,12 @@
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
<item>
<key> <string>portal_types</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>selection_name</string> </key> <key> <string>selection_name</string> </key>
<value> <string>pay_sheet_transaction_line_list_selection</string> </value> <value> <string>pay_sheet_transaction_line_list_selection</string> </value>
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>items</string> <string>items</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -86,6 +86,12 @@ ...@@ -86,6 +86,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value> <value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>css_class</string> <string>css_class</string>
<string>input_style</string>
<string>display_width</string> <string>display_width</string>
<string>input_style</string>
<string>precision</string> <string>precision</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -91,6 +91,10 @@ ...@@ -91,6 +91,10 @@
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string>figure</string> </value> <value> <string>figure</string> </value>
</item> </item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_float_field</string> </value> <value> <string>my_float_field</string> </value>
...@@ -103,6 +107,10 @@ ...@@ -103,6 +107,10 @@
<key> <string>input_style</string> </key> <key> <string>input_style</string> </key>
<value> <string>-1 234.5</string> </value> <value> <string>-1 234.5</string> </value>
</item> </item>
<item>
<key> <string>precision</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>css_class</string> <string>css_class</string>
<string>input_style</string>
<string>display_width</string> <string>display_width</string>
<string>input_style</string>
<string>precision</string> <string>precision</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -91,6 +91,10 @@ ...@@ -91,6 +91,10 @@
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string>figure</string> </value> <value> <string>figure</string> </value>
</item> </item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_float_field</string> </value> <value> <string>my_float_field</string> </value>
...@@ -103,6 +107,10 @@ ...@@ -103,6 +107,10 @@
<key> <string>input_style</string> </key> <key> <string>input_style</string> </key>
<value> <string>-1 234.5</string> </value> <value> <string>-1 234.5</string> </value>
</item> </item>
<item>
<key> <string>precision</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>items</string> <string>items</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -86,6 +86,12 @@ ...@@ -86,6 +86,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value> <value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
<value> <value>
<list> <list>
<string>description</string> <string>description</string>
<string>title</string>
<string>items</string> <string>items</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -91,6 +91,12 @@ ...@@ -91,6 +91,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value> <value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
<value> <value>
<list> <list>
<string>description</string> <string>description</string>
<string>title</string>
<string>editable</string> <string>editable</string>
<string>items</string> <string>items</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -96,6 +96,12 @@ ...@@ -96,6 +96,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value> <value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
<value> <value>
<list> <list>
<string>description</string> <string>description</string>
<string>title</string>
<string>items</string> <string>items</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -91,6 +91,12 @@ ...@@ -91,6 +91,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value> <value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
<value> <value>
<list> <list>
<string>description</string> <string>description</string>
<string>title</string>
<string>items</string> <string>items</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -91,6 +91,12 @@ ...@@ -91,6 +91,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value> <value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -62,7 +62,7 @@ AAA=</string> </value> ...@@ -62,7 +62,7 @@ AAA=</string> </value>
</item> </item>
<item> <item>
<key> <string>ooo_stylesheet</string> </key> <key> <string>ooo_stylesheet</string> </key>
<value> <string>PaySheet_getODTStyleSheet</string> </value> <value> <string>PaySheetTransaction_getODTStyleSheet</string> </value>
</item> </item>
<item> <item>
<key> <string>ooo_xml_file_id</string> </key> <key> <string>ooo_xml_file_id</string> </key>
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>items</string> <string>items</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -86,6 +86,12 @@ ...@@ -86,6 +86,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value> <value> <string>Base_viewFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</item> </item>
<item> <item>
<key> <string>action</string> </key> <key> <string>action</string> </key>
<value> <string>PaySheet_printAsODT</string> </value> <value> <string>PaySheetTransaction_printAsODT</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>PaySheet_viewODTPrintDialog</string> </value> <value> <string>PaySheetTransaction_viewODTPrintDialog</string> </value>
</item> </item>
<item> <item>
<key> <string>method</string> </key> <key> <string>method</string> </key>
......
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>description</string>
<string>title</string>
<string>default</string> <string>default</string>
<string>description</string>
<string>items</string> <string>items</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -86,6 +86,10 @@ ...@@ -86,6 +86,10 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>Printing format</string> </value> <value> <string>Printing format</string> </value>
...@@ -98,6 +102,12 @@ ...@@ -98,6 +102,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value> <value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
<key> <string>right</string> </key> <key> <string>right</string> </key>
<value> <value>
<list> <list>
<string>my_validation_state_title</string> <string>my_translated_validation_state_title</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_validation_state_title</string> </value> <value> <string>my_translated_validation_state_title</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
<key> <string>right</string> </key> <key> <string>right</string> </key>
<value> <value>
<list> <list>
<string>my_validation_state_title</string> <string>my_translated_validation_state_title</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_validation_state_title</string> </value> <value> <string>my_translated_validation_state_title</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
portal = context.getObject() portal = context.getObject()
organisation_module = portal.getDefaultModuleValue("Organisation") organisation_module = portal.getDefaultModuleValue("Organisation")
def getObjectOrRaise(module, id): def getObjectOrRaise(module, object_id):
obj = getattr(module, id, None) obj = getattr(module, object_id, None)
if obj is None: if obj is None:
raise AttributeError("%s doesn't have sub-object with id %s" % (module, id)) raise AttributeError("%s doesn't have sub-object with id %s" % (module, object_id))
else: else:
return obj return obj
......
<?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>_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/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_edit</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </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>my_reference</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list>
<string>my_quantity</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>RatioSettings_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>PaySheetTransaction_viewAnnotationLine</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view</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>Ratio Settings</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>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
<string>description</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_quantity</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string>The Value for this ratio setting.</string> </value>
</item>
<item>
<key> <string>editable_permission</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>editable_role</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_quantity</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>not_viewable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>read_only</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Ratio Setting Value</string> </value>
</item>
<item>
<key> <string>viewable_permission</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>viewable_role</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
<string>description</string>
<string>required</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_reference</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string>The Reference for this Ratio. A ratio can be overriden by another one from another model, if the use the same reference.</string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Reference</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
############################################################################## ##############################################################################
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5ReportTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5ReportTestCase
from erp5.component.test.testTradeModelLine import TestTradeModelLineMixin from erp5.component.test.testTradeModelLine import TestTradeModelLineMixin
from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.utils import reindex from Products.ERP5Type.tests.utils import reindex
from DateTime import DateTime from DateTime import DateTime
...@@ -148,13 +147,6 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase): ...@@ -148,13 +147,6 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
self.portal.business_process_module.manage_delObjects(list([x for x in self.portal.business_process_module.objectIds() if x != "erp5_default_business_process"])) self.portal.business_process_module.manage_delObjects(list([x for x in self.portal.business_process_module.objectIds() if x != "erp5_default_business_process"]))
def login(self):
uf = self.getPortal().acl_users
uf._doAddUser('admin', '', ['Manager', 'Assignee', 'Assignor',
'Associate', 'Auditor', 'Author'], [])
user = uf.getUserById('admin').__of__(uf)
newSecurityManager(None, user)
@reindex @reindex
def createCategories(self): def createCategories(self):
"""Create the categories for our test. """ """Create the categories for our test. """
...@@ -328,10 +320,12 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase): ...@@ -328,10 +320,12 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
) )
sequence.edit(model = model) sequence.edit(model = model)
def addSlice(self, model, slice, min_value, max_value, base_id='cell'): def addSlice(self, model, paysheet_model_slice, min_value, max_value, base_id='cell'):
'''add a new slice in the model''' '''add a new slice in the model'''
slice_value = model.newCell(slice, portal_type='Pay Sheet Model Slice', slice_value = model.newCell(
base_id=base_id) paysheet_model_slice,
portal_type='Pay Sheet Model Slice',
base_id=base_id)
slice_value.setQuantityRangeMax(max_value) slice_value.setQuantityRangeMax(max_value)
slice_value.setQuantityRangeMin(min_value) slice_value.setQuantityRangeMin(min_value)
return slice_value return slice_value
...@@ -588,7 +582,7 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase): ...@@ -588,7 +582,7 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
expected_movement_to_delete_count, expected_movement_to_add_count): expected_movement_to_delete_count, expected_movement_to_add_count):
movement_dict = paysheet.updateAggregatedAmountList() movement_dict = paysheet.updateAggregatedAmountList()
movement_to_delete = movement_dict['movement_to_delete_list'] movement_to_delete = movement_dict['movement_to_delete_list']
movement_to_add = movement_dict['movement_to_add_list'] # movement_to_add = movement_dict['movement_to_add_list']
self.assertEqual(len(movement_to_delete), self.assertEqual(len(movement_to_delete),
expected_movement_to_delete_count) expected_movement_to_delete_count)
# self.assertEqual(len(movement_to_add), expected_movement_to_add_count) # self.assertEqual(len(movement_to_add), expected_movement_to_add_count)
...@@ -1540,7 +1534,7 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase): ...@@ -1540,7 +1534,7 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
portal_type_list = ['Pay Sheet Model Line',] portal_type_list = ['Pay Sheet Model Line',]
# if no reference, we don't care about dates # if no reference, we don't care about dates
sub_object_list = paysheet.getInheritedObjectValueList(portal_type_list) paysheet.getInheritedObjectValueList(portal_type_list)
self.assertEqual(len(paysheet.contentValues(\ self.assertEqual(len(paysheet.contentValues(\
portal_type='Pay Sheet Line')), 0) portal_type='Pay Sheet Line')), 0)
...@@ -1607,8 +1601,6 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase): ...@@ -1607,8 +1601,6 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
paysheet_with_date.PaySheetTransaction_applyModel() paysheet_with_date.PaySheetTransaction_applyModel()
self.tic() self.tic()
portal_type_list = ['Pay Sheet Model Line',]
# check the paysheet contains no lines before calculation # check the paysheet contains no lines before calculation
self.assertEqual(len(paysheet_with_date.contentValues(\ self.assertEqual(len(paysheet_with_date.contentValues(\
portal_type='Pay Sheet Line')), 0) portal_type='Pay Sheet Line')), 0)
...@@ -1954,9 +1946,8 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase): ...@@ -1954,9 +1946,8 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
form = getattr(here, report_section.getFormId()) form = getattr(here, report_section.getFormId())
self.portal.REQUEST['here'] = here self.portal.REQUEST['here'] = here
if form.has_field('listbox'): if form.has_field('listbox'):
result = form.listbox.get_value('default', form.listbox.get_value(
render_format='list', 'default', render_format='list', REQUEST=self.portal.REQUEST)
REQUEST=self.portal.REQUEST)
self.assertEqual(precision, self.portal.REQUEST.get('precision')) self.assertEqual(precision, self.portal.REQUEST.get('precision'))
report_section.popReport(self.portal) report_section.popReport(self.portal)
......
...@@ -43,14 +43,7 @@ ...@@ -43,14 +43,7 @@
<item> <item>
<key> <string>text_content_warning_message</string> </key> <key> <string>text_content_warning_message</string> </key>
<value> <value>
<tuple> <tuple/>
<string>W:151, 2: Arguments number differs from overridden \'login\' method (arguments-differ)</string>
<string>W:331, 28: Redefining built-in \'slice\' (redefined-builtin)</string>
<string>W:591, 4: Unused variable \'movement_to_add\' (unused-variable)</string>
<string>W:1543, 4: Unused variable \'sub_object_list\' (unused-variable)</string>
<string>W:1610, 4: Unused variable \'portal_type_list\' (unused-variable)</string>
<string>W:1957, 6: Unused variable \'result\' (unused-variable)</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
......
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