Commit 8fb03520 authored by Jérome Perrin's avatar Jérome Perrin

show editable fields on lines for payment

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26919 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0cb7025e
......@@ -61,9 +61,11 @@ If there is more than one mirror_section on lines, the listbox will have an\n
extra column showing mirror_section_title.\n
The same for apply for payment / payment_reference.\n
"""\n
movement_type_list = context.getPortalAccountingMovementTypeList()\n
\n
section_dict = {None: 1}\n
payment_dict = {None: 1}\n
for line in context.getMovementList():\n
for line in context.getMovementList(portal_type=movement_type_list):\n
section_dict[line.getSourceSection()] = 1\n
section_dict[line.getDestinationSection()] = 1\n
payment_dict[line.getSourcePayment()] = 1\n
......@@ -84,6 +86,23 @@ else:\n
multiple_sections = len(section_dict) > min_section_count\n
multiple_payment = len(payment_dict) > min_payment_count\n
\n
# we also show multiple payments if there is more than one "asset/cash/bank" account\n
# used on this side.\n
bank_type_account_count = 0\n
if not multiple_payment and context.getPortalType() == \'Payment Transaction\':\n
for line in context.getMovementList(portal_type=movement_type_list):\n
if source:\n
account = line.getSourceValue(portal_type=\'Account\')\n
else:\n
account = line.getDestinationValue(portal_type=\'Account\')\n
if account is not None and \\\n
account.isMemberOf(\'account_type/asset/cash/bank\'):\n
bank_type_account_count += 1\n
if bank_type_account_count > 1:\n
multiple_payment = 1\n
break\n
\n
\n
column_item_list = [(\'translated_id\', \'ID\')]\n
a = column_item_list.append\n
if source:\n
......@@ -96,10 +115,17 @@ if multiple_sections:\n
else:\n
a((\'getSourceSectionTitle\', \'Third Party\'))\n
if multiple_payment:\n
if context.getPortalType() == \'Payment Transaction\':\n
if source:\n
a((\'source_payment\', \'Bank Account\'))\n
else:\n
a((\'destination_payment\', \'Bank Account\'))\n
else:\n
if source:\n
a((\'getSourcePaymentReference\', \'Bank Account\'))\n
else:\n
a((\'getDestinationPaymentReference\', \'Bank Account\'))\n
\n
if source:\n
a((\'source_debit\', \'Debit\'))\n
a((\'source_credit\', \'Credit\'))\n
......@@ -147,12 +173,13 @@ return column_item_list\n
<value>
<tuple>
<string>source</string>
<string>_getattr_</string>
<string>context</string>
<string>movement_type_list</string>
<string>None</string>
<string>section_dict</string>
<string>payment_dict</string>
<string>_getiter_</string>
<string>_getattr_</string>
<string>context</string>
<string>line</string>
<string>_write_</string>
<string>min_payment_count</string>
......@@ -160,6 +187,9 @@ return column_item_list\n
<string>len</string>
<string>multiple_sections</string>
<string>multiple_payment</string>
<string>bank_type_account_count</string>
<string>account</string>
<string>_inplacevar_</string>
<string>column_item_list</string>
<string>a</string>
</tuple>
......
......@@ -85,6 +85,7 @@
<string>listbox_source</string>
<string>listbox_source_debit</string>
<string>listbox_source_credit</string>
<string>listbox_source_payment</string>
</list>
</value>
</item>
......
......@@ -13,15 +13,15 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>stat_columns</string>
<string>editable_columns</string>
<string>stat_method</string>
<string>title</string>
<string>selection_name</string>
<string>columns</string>
<string>list_method</string>
<string>anchor</string>
<string>stat_method</string>
<string>selection_name</string>
<string>portal_types</string>
<string>anchor</string>
<string>editable_columns</string>
<string>stat_columns</string>
</list>
</value>
</item>
......@@ -141,6 +141,10 @@
<string>source</string>
<string>Account</string>
</tuple>
<tuple>
<string>source_payment</string>
<string>Bank Account</string>
</tuple>
</list>
</value>
</item>
......@@ -158,6 +162,12 @@
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>portal_types</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>selection_name</string> </key>
<value> <string>payment_transaction_selection</string> </value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
<string>items</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_source_payment</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>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_list_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewAccountingFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</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>Section Bank Account</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.AccountingTransaction_getSourcePaymentItemList()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -100,6 +100,7 @@
<string>my_reference</string>
<string>my_resource</string>
<string>my_payment_mode</string>
<string>listbox_destination_payment</string>
</list>
</value>
</item>
......
......@@ -13,15 +13,15 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>stat_columns</string>
<string>editable_columns</string>
<string>stat_method</string>
<string>title</string>
<string>selection_name</string>
<string>columns</string>
<string>list_method</string>
<string>anchor</string>
<string>stat_method</string>
<string>selection_name</string>
<string>portal_types</string>
<string>anchor</string>
<string>editable_columns</string>
<string>stat_columns</string>
</list>
</value>
</item>
......@@ -141,6 +141,10 @@
<string>destination</string>
<string>Account</string>
</tuple>
<tuple>
<string>destination_payment</string>
<string>Section Bank Account</string>
</tuple>
</list>
</value>
</item>
......@@ -158,6 +162,12 @@
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>portal_types</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>selection_name</string> </key>
<value> <string>payment_transaction_destination_selection</string> </value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
<string>items</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_destination_payment</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>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_list_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewAccountingFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</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>Section Bank Account</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.AccountingTransaction_getDestinationPaymentItemList()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
917
\ No newline at end of file
918
\ No newline at end of file
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