Commit f90d189a authored by Tomáš Peterka's avatar Tomáš Peterka

Merge branch 'feature/jio-action-accounting' into test/rjs

parents 4378f763 044d186d
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_button</string>
<string>action_type/object_jio_button</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_button</string> </value>
<value> <string>object_jio_button</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_exchange</string>
<string>action_type/object_jio_exchange</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_exchange</string> </value>
<value> <string>object_jio_exchange</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_exchange</string>
<string>action_type/object_jio_exchange</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_exchange</string> </value>
<value> <string>object_jio_exchange</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_exchange</string>
<string>action_type/object_jio_exchange</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_exchange</string> </value>
<value> <string>object_jio_exchange</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_action</string>
<string>action_type/object_jio_action</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_action</string> </value>
<value> <string>object_jio_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_action</string>
<string>action_type/object_jio_action</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_action</string> </value>
<value> <string>object_jio_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_exchange</string>
<string>action_type/object_jio_exchange</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_exchange</string> </value>
<value> <string>object_jio_exchange</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_button</string>
<string>action_type/object_jio_button</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_button</string> </value>
<value> <string>object_jio_button</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_exchange</string>
<string>action_type/object_jio_exchange</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_exchange</string> </value>
<value> <string>object_jio_exchange</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_exchange</string>
<string>action_type/object_jio_exchange</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_exchange</string> </value>
<value> <string>object_jio_exchange</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_exchange</string>
<string>action_type/object_jio_exchange</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_exchange</string> </value>
<value> <string>object_jio_exchange</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_report</string>
<string>action_type/object_jio_report</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_report</string> </value>
<value> <string>object_jio_report</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_exchange</string>
<string>action_type/object_jio_exchange</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_exchange</string> </value>
<value> <string>object_jio_exchange</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_report</string>
<string>action_type/object_jio_report</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_report</string> </value>
<value> <string>object_jio_report</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_button</string>
<string>action_type/object_jio_button</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_button</string> </value>
<value> <string>object_jio_button</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_exchange</string>
<string>action_type/object_jio_exchange</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_exchange</string> </value>
<value> <string>object_jio_exchange</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_report</string>
<string>action_type/object_jio_report</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_report</string> </value>
<value> <string>object_jio_report</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_exchange</string>
<string>action_type/object_jio_exchange</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_exchange</string> </value>
<value> <string>object_jio_exchange</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_report</string>
<string>action_type/object_jio_report</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_report</string> </value>
<value> <string>object_jio_report</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_button</string>
<string>action_type/object_jio_button</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_button</string> </value>
<value> <string>object_jio_button</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_action</string>
<string>action_type/object_jio_action</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_action</string> </value>
<value> <string>object_jio_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_action</string>
<string>action_type/object_jio_action</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_action</string> </value>
<value> <string>object_jio_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......
......@@ -175,7 +175,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: list(context.getPortalItemTypeList()) + (\'Payment Transaction Group\', )</string> </value>
<value> <string>python: list(context.getPortalItemTypeList()) + [\'Payment Transaction Group\', ]</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -4,9 +4,13 @@ portal = context.getPortalObject()
countMessage = portal.portal_activities.countMessage
invoice_type_list = portal.getPortalInvoiceTypeList()
portal.portal_selections.updateSelectionCheckedUidList(selection_name, listbox_uid, uids)
selection_uid_list = portal.portal_selections.getSelectionCheckedUidsFor(
selection_name)
if selection_name:
portal.portal_selections.updateSelectionCheckedUidList(selection_name, listbox_uid, uids)
selection_uid_list = portal.portal_selections.getSelectionCheckedUidsFor(
selection_name)
else:
selection_uid_list = uids
if selection_uid_list:
object_list = [brain.getObject() for brain in portal.portal_catalog(uid=selection_uid_list)]
else:
......@@ -20,10 +24,9 @@ portal.portal_selections.setSelectionParamsFor('accounting_create_related_paymen
# XXX prevent to call this on the whole module:
if len(object_list) >= 1000:
return context.Base_redirect(
form_id,
keep_items={'portal_status_message': translateString(
'Refusing to process more than 1000 objects, check your selection.')})
return context.Base_renderMessage(
translateString('Refusing to process more than 1000 objects, check your selection.'),
'warning')
tag = 'payment_creation_%s' % random.randint(0, 1000)
activated = 0
......
......@@ -24,9 +24,12 @@ for obj in object_list:
obj = obj.getObject()
if countMessage(path=obj.getPath(),
method_id='AccountingTransaction_createReversalTransaction'):
raise Redirect, "%s/view?portal_status_message=%s" % (
context.absolute_url(), translateString(
'Reversal creation already in progress, abandon.'))
return context.Base_redirect(form_id,
abort_transaction=True,
keep_items={
"portal_status_message": translateString('Reversal creation already in progress, abandon.'),
"portal_status_level": 'error'
})
obj.activate(tag=tag).AccountingTransaction_createReversalTransaction(
cancellation_amount=cancellation_amount,
date=date,
......
......@@ -8,11 +8,13 @@ psm = Base_translateString('Nothing matches.')
request = container.REQUEST
# update selected uids
portal.portal_selections.updateSelectionCheckedUidList(
list_selection_name, uids=uids, listbox_uid=listbox_uid, REQUEST=request)
uids = portal.portal_selections.getSelectionCheckedUidsFor(list_selection_name)
if list_selection_name:
portal.portal_selections.updateSelectionCheckedUidList(
list_selection_name, uids=uids, listbox_uid=listbox_uid, REQUEST=request)
uids = portal.portal_selections.getSelectionCheckedUidsFor(list_selection_name)
# XXX when should it be validated ?
# Kato: It is already validated because this is Form Dialog script
if node == '':
node = context.REQUEST.get('field_your_node', node)
if mirror_section == '':
......@@ -22,13 +24,13 @@ if grouping == '':
grouping = request.get('your_grouping',
request.get('field_your_grouping',
grouping))
# edit selection for dialog parameters
portal.portal_selections.setSelectionParamsFor(
'grouping_reference_fast_input_selection',
params=dict(node=node,
grouping=grouping,
mirror_section=mirror_section))
if list_selection_name:
# edit selection for dialog parameters
portal.portal_selections.setSelectionParamsFor(
'grouping_reference_fast_input_selection',
params=dict(node=node,
grouping=grouping,
mirror_section=mirror_section))
# calculate total selected amount
total_selected_amount = 0
......@@ -42,9 +44,9 @@ if uids:
request.set('total_selected_amount', total_selected_amount)
if update:
request.set('portal_status_message', Base_translateString('Updated'))
return context.AccountingTransactionModule_viewGroupingFastInputDialog(request)
return context.Base_renderForm('AccountingTransactionModule_viewGroupingFastInputDialog',
keep_items={'portal_status_message': Base_translateString('Updated')})
# otherwise, try to group...
if grouping == 'grouping':
......@@ -53,9 +55,9 @@ if grouping == 'grouping':
if grouped_line_list:
psm = Base_translateString('${grouped_line_count} lines grouped.',
mapping=dict(grouped_line_count=len(grouped_line_list)))
# make sure nothing will be checked next time
portal.portal_selections.setSelectionCheckedUidsFor(list_selection_name, [])
if list_selection_name:
# make sure nothing will be checked next time
portal.portal_selections.setSelectionCheckedUidsFor(list_selection_name, [])
# we check if we can mark some transaction as payed.
transaction_list = {}
......@@ -119,8 +121,9 @@ else:
psm = Base_translateString('${ungrouped_line_count} lines ungrouped.',
mapping=dict(ungrouped_line_count=len(ungrouped_line_list)))
# make sure nothing will be checked next time
portal.portal_selections.setSelectionCheckedUidsFor(list_selection_name, [])
if list_selection_name:
# make sure nothing will be checked next time
portal.portal_selections.setSelectionCheckedUidsFor(list_selection_name, [])
request.set('portal_status_message', psm)
return context.AccountingTransactionModule_viewGroupingFastInputDialog(request)
return context.Base_renderForm('AccountingTransactionModule_viewGroupingFastInputDialog',
keep_items={'portal_status_message': psm})
......@@ -223,7 +223,7 @@
</item>
<item>
<key> <string>first_item</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>hidden</string> </key>
......
......@@ -4,8 +4,9 @@
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><th rowspan="1" colspan="4">
Copy of unittest <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product/ERP5/tests/testAccountingReports.py#L894">testAccountingReports.py:TestAccountingReports.testAccountStatement</a>
Copy of unittest <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product/ERP5/tests/testAccountingReports.py#L894">testAccountingReports.py:TestAccountingReports.testAccountStatement</a> (expected failure)
</th></tr>
<!-- This report is not using template fields and overwrites columns dynamicaly in Selection. This report will not be tested -->
</thead>
<tbody
......@@ -43,17 +44,6 @@ Copy of unittest <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product
<tr><td>click</td>
<td>//a[@data-i18n="Account Statement"]</td><td></td></tr>
<tr><td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="field_your_node"]/div/div[1]//select</td><td></td></tr>
<tr><td>select</td>
<td>//div[@data-gadget-scope="field_your_node"]/div/div[1]//select</td>
<td>value=account_module/receivable</td></tr>
<tr><td>waitForElementPresent</td>
<td>//select[@name="field_your_section_category"]</td><td></td></tr>
<tr><td>select</td>
<td>//select[@name="field_your_section_category"]</td>
<td>value=group/demo_group/sub1</td></tr>
<tr><td>waitForElementPresent</td>
<td>//input[@name="field_your_at_date"]</td><td></td></tr>
<tr><td>type</td>
......@@ -77,14 +67,57 @@ Copy of unittest <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product
<tr><td>select</td>
<td>//div[@data-gadget-scope="field_your_simulation_state"]/div/div[1]//select</td>
<td>value=delivered</td></tr>
<tr><td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="field_your_node"]/div/div[1]//select</td><td></td></tr>
<tr><td>select</td>
<td>//div[@data-gadget-scope="field_your_node"]/div/div[1]//select</td>
<td>value=account_module/receivable</td></tr>
<tr><td colspan="3">Test update button on a valid form</td></tr>
<!-- group/client does not have any Bank account assigned so we test on empty "Bank Account" field -->
<tr><td>waitForElementPresent</td>
<td>//select[@name="field_your_section_category"]</td><td></td></tr>
<tr><td>select</td>
<td>//select[@name="field_your_section_category"]</td>
<td>value=group/client</td></tr>
<tr><td>click</td>
<td>//div[@data-gadget-url="${renderjs_url}/gadget_erp5_page_form.html"]//button[@type="submit" and @name="action_update"]</td><td></td></tr>
<tr><td>waitForElementNotPresent</td>
<td>//select[@name="field_your_payment"]/option[2]</td><td></td></tr>
<tr><td>assertElementNotPresent</td>
<td>//select[@name="field_your_payment"]/option[2]</td><td></td></tr>
<tr><td>waitForElementPresent</td>
<td>//select[@name="field_your_section_category"]</td><td></td></tr>
<tr><td>select</td>
<td>//select[@name="field_your_section_category"]</td>
<td>value=group/demo_group/sub1</td></tr>
<tr><td>type</td>
<td>//input[@name="field_your_portal_skin"]</td>
<td>Hal</td></tr>
<tr><td>click</td>
<td>//div[@data-gadget-url="${renderjs_url}/gadget_erp5_page_form.html"]//button[@type="submit" and @name="action_update"]</td><td></td></tr>
<tr><td>waitForElementPresent</td>
<td>//select[@name="field_your_payment"]/option[2]</td><td></td></tr>
<tr><td>assertElementPresent</td>
<td>//select[@name="field_your_payment"]/option[@data-i18n="Bank1"]</td><td></td></tr>
<tr><td>assertElementPresent</td>
<td>//select[@name="field_your_payment"]/option[@data-i18n="Bank2"]</td><td></td></tr>
<tr><td>click</td>
<td>//div[@data-gadget-url="${renderjs_url}/gadget_erp5_page_form.html"]//input[@type="submit"]</td><td></td></tr>
<td>//div[@data-gadget-url="${renderjs_url}/gadget_erp5_page_form.html"]//input[@type="submit" and @name="action_confirm"]</td><td></td></tr>
<tr><td>store</td>
<td>//div[@data-gadget-url="${renderjs_url}/gadget_erp5_field_listbox.html"]//table</td>
<td>table</td></tr>
<tr><td>waitForElementPresent</td>
<td>${table}//../nav//span[text()="6 Records"]</td><td></td></tr>
<td>${table}/../nav//span[text()="6 Records"]</td><td></td></tr>
<tr><td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="field_your_currency"]//p[text()="EUR"]</td><td></td></tr>
......
<html>
<head><title>Test Aged Balance Report</title></head>
<head><title>Test Aged Balance Report (expected failure)</title></head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><th rowspan="1" colspan="4">
Copy of unittest <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product/ERP5/tests/testAccountingReports.py#L4904">testAccountingReports.py:test_simple_aged_creditor_report_detailed.testOtherPartiesReport</a>
</th></tr>
<tr><td rowspan="1" colspan="3">
Copy of unittest <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product/ERP5/tests/testAccountingReports.py#L4904">test_simple_aged_creditor_report_detailed.testOtherPartiesReport</a> (expected failure)
</td></tr>
</thead>
<tbody
......@@ -32,11 +32,17 @@ Copy of unittest <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product
<td>//a[@data-i18n="Export"]</td><td></td></tr>
<tr><td>click</td>
<td>//a[@data-i18n="Export"]</td><td></td></tr>
<!-- Remove when the test is fixed -->
<tr><td>setTimeout</td><td>2000</td><td></td></tr>
<tr><td>waitForElementPresent</td>
<td>//a[@data-i18n="Aged Balance"]</td><td></td></tr>
<!-- Remove when the test is fixed -->
<tr><td>assertElementPresent</td>
<td>//a[@data-i18n="Aged Balance"]</td><td></td></tr>
<tr><td>click</td>
<td>//a[@data-i18n="Aged Balance"]</td><td></td></tr>
<!-- Remove when the test is fixed -->
<tr><td>setTimeout</td><td>36000</td><td></td></tr>
<tr><td>waitForElementPresent</td>
<td>//select[@name="field_your_section_category"]</td><td></td></tr>
......@@ -74,6 +80,11 @@ Copy of unittest <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product
<tr><td>select</td>
<td>//div[@data-gadget-scope="field_your_simulation_state"]/div/div[1]//select</td>
<td>value=delivered</td></tr>
<tr><td>type</td>
<td>//input[@name="field_your_portal_skin"]</td>
<td>Hal</td></tr>
<tr><td>click</td>
<td>//div[@data-gadget-url="${renderjs_url}/gadget_erp5_page_form.html"]//input[@type="submit"]</td><td></td></tr>
......@@ -81,6 +92,7 @@ Copy of unittest <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product
<tr><td>store</td>
<td>//div[@data-gadget-url="${renderjs_url}/gadget_erp5_field_listbox.html"]//table</td>
<td>table</td></tr>
<tr><td>waitForElementPresent</td>
<td>${table}/../nav//span[text()="1 Records"]</td><td></td></tr>
......
......@@ -47,7 +47,7 @@ Copy of unittest <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product
<tr><td>waitForElementPresent</td><td>//input[@name="field_your_from_date"]</td><td></td></tr>
<tr><td>type</td>
<td>//input[@name="field_your_from_date"]</td>
<td>${year}-1-1</td></tr>
<td>${year}-01-01</td></tr>
<tr><td>waitForElementPresent</td><td>//input[@name="field_your_at_date"]</td><td></td></tr>
<tr><td>type</td>
<td>//input[@name="field_your_at_date"]</td>
......@@ -75,6 +75,15 @@ Copy of unittest <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product
<td>//div[@data-gadget-scope="field_your_simulation_state"]/div/div[1]//select</td>
<td>value=delivered</td></tr>
<tr><th colspan="3">Override fields set by Action URL parameters to out values</th></tr>
<!-- No Titles are displayed if "export" is checked. Should we remove the check for title (<h3>) instead? -->
<tr><td>click</td>
<td>//input[@name="field_your_export"]</td><td></td></tr>
<!-- Force rendering inplace by replacinf ODS style with Hal -->
<tr><td>type</td>
<td>//input[@name="field_your_portal_skin"]</td>
<td>Hal</td></tr>
<tr><td>click</td>
<td>//div[@data-gadget-url="${renderjs_url}/gadget_erp5_page_form.html"]//input[@type="submit"]</td><td></td></tr>
......
......@@ -69,6 +69,11 @@ Copy of <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product/ERP5/tes
<tr><td>select</td>
<td>//div[@data-gadget-scope="field_your_simulation_state"]/div/div[1]//select</td>
<td>value=delivered</td></tr>
<tr><td>type</td>
<td>//input[@name="field_your_portal_skin"]</td>
<td>Hal</td></tr>
<tr><td>click</td>
<td>//div[@data-gadget-url="${renderjs_url}/gadget_erp5_page_form.html"]//input[@type="submit"]</td><td></td></tr>
......@@ -84,12 +89,16 @@ Copy of <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product/ERP5/tes
<tr><td>store</td><td tal:content="python: '{:0>#2d}'.format(now.day())"></td><td>day</td></tr>
<tr><td>store</td><td tal:content="python: '{:0>#2d}'.format(now.month())"></td><td>month</td></tr>
<tr><td>store</td><td tal:content="python: now.year()"></td><td>year</td></tr>
<!-- node_title mapping
A-REC = 41
A-COLLECTED-VAT = 4457
A-GS = 7
-->
<tal:block tal:define="row_selector string:$${table}/tbody/tr[1];
date string:$${year}-$${month}-$${day};
title string:First One;
parent_reference string:1;
node_title string:A-REC;
node_title string:41;
mirror_section_title string:Client 1;
debit string:119.60;
credit string:0">
......@@ -99,7 +108,7 @@ Copy of <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product/ERP5/tes
specific_reference string:;
title string:;
parent_reference string:;
node_title string:A-COLLECTED-VAT;
node_title string:4457;
mirror_section_title string:Client 1;
debit string:0,
credit string:19.60">
......@@ -110,7 +119,7 @@ Copy of <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product/ERP5/tes
specific_reference string:;
title string:;
parent_reference string:;
node_title string:A-GS;
node_title string:7;
mirror_section_title string:Client 1;
debit string:0;
credit string:100">
......@@ -122,7 +131,7 @@ Copy of <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product/ERP5/tes
date string:$${year}-$${month}-$${day};
title string:Second One;
parent_reference string:2;
node_title string:A-REC;
node_title string:41;
mirror_section_title string:Client 2;
debit string:239.20;
credit string:0">
......@@ -132,7 +141,7 @@ Copy of <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product/ERP5/tes
specific_reference string:;
title string:;
parent_reference string:;
node_title string:A-COLLECTED-VAT;
node_title string:4457;
mirror_section_title string:Client 2;
debit string:0;
credit string:39.20">
......@@ -142,7 +151,7 @@ Copy of <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product/ERP5/tes
specific_reference string:;
title string:;
parent_reference string:;
node_title string:A-GS;
node_title string:7;
mirror_section_title string:Client 2;
debit string:0;
credit string:200">
......@@ -154,7 +163,7 @@ Copy of <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product/ERP5/tes
date string:$${year}-$${month}-$${day};
title string:Third One;
parent_reference string:3;
node_title string:A-REC;
node_title string:41;
mirror_section_title string:John Smith;
debit string:358.80;
credit string:0">
......@@ -164,7 +173,7 @@ Copy of <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product/ERP5/tes
specific_reference string:;
title string:;
parent_reference string:;
node_title string:A-COLLECTED-VAT;
node_title string:4457;
mirror_section_title string:John Smith;
debit string:0;
credit string:58.80">
......@@ -174,7 +183,7 @@ Copy of <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product/ERP5/tes
specific_reference string:;
title string:Line Title;
parent_reference string:;
node_title string:A-GS;
node_title string:7;
mirror_section_title string:John Smith;
debit string:0;
credit string:300">
......
......@@ -71,6 +71,11 @@ Copy of unittest <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product
<tr><td>select</td>
<td>//div[@data-gadget-scope="field_your_simulation_state"]/div/div[1]//select</td>
<td>value=delivered</td></tr>
<tr><td>type</td>
<td>//input[@name="field_your_portal_skin"]</td>
<td>Hal</td></tr>
<tr><td>click</td>
<td>//div[@data-gadget-url="${renderjs_url}/gadget_erp5_page_form.html"]//input[@type="submit"]</td><td></td></tr>
......@@ -82,12 +87,15 @@ Copy of unittest <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product
<tr><td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="field_your_currency"]//p[text()="EUR"]</td><td></td></tr>
<!-- GAP mapping:
A-REC = 41
A-PAY = 40
-->
<tal:block tal:define="row_selector string:$${table}/tbody/tr[1];
Movement_getExplanationTitle string:Transaction 1;
section_title string:;
Movement_getExplanationTranslatedPortalType string:Accounting Transaction;
Movement_getNodeGapId string:A-REC;
Movement_getNodeGapId string:41;
Movement_getExplanationReference string:;
Movement_getSpecificReference string:1;
getTranslatedSimulationStateTitle string:Closed;
......@@ -101,7 +109,7 @@ Copy of unittest <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product
Movement_getExplanationTitle string:Transaction 2;
section_title string:;
Movement_getExplanationTranslatedPortalType string:Accounting Transaction;
Movement_getNodeGapId string:A-PAY;
Movement_getNodeGapId string:40;
Movement_getExplanationReference string:;
Movement_getSpecificReference string:2;
getTranslatedSimulationStateTitle string:Closed;
......
......@@ -71,6 +71,10 @@ Copy of unittest <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product
<td>${multi_select}/div[3]//select</td>
<td></td></tr>
<tr><td>type</td>
<td>//input[@name="field_your_portal_skin"]</td>
<td>Hal</td></tr>
<tr><td>click</td>
<td>//div[@data-gadget-url="${renderjs_url}/gadget_erp5_page_form.html"]//input[@type="submit"]</td><td></td></tr>
......@@ -83,51 +87,42 @@ Copy of unittest <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product
<tr><td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="field_your_currency"]//p[text()="EUR"]</td><td></td></tr>
<!-- node_id mapping
Sometimes the display of node_id changes between numbers and strings.
A-EQUITY = 1
A-FIX-ASSETS = 2
A-STOCK = 3
A-PAY = 40
A-REC = 41
A-REF-VAT = 4456
A-COLLECTED-VAT = 4457
A-BANK = 5
A-GP = 6
A-GS = 7
->
<!-- ListBox sorts the result in different order than they are returned by its
List Method. Seems they are sorted on Title alphabetically -->
List Method. Seems they are sorted on node_id -->
<tal:block tal:define="row_selector string:$${table}/tbody/tr[1];
node_id string:A-BANK;
node_title string:Bank (Bank1);
credit string:3300;
final_balance string:-3300;
final_credit_balance string:3300;
final_balance_if_credit string:3300">
node_id string:1;
node_title string:Equity">
<tal:block metal:use-macro="here/AccountingZuite_reportMacros/macros/check_row_in_balance_table" />
</tal:block>
<tal:block tal:define="row_selector string:$${table}/tbody/tr[2];
node_id string:A-COLLECTED-VAT;
node_title string:Collected VAT 10%">
node_id string:2;
node_title string:Fixed Assets">
<tal:block metal:use-macro="here/AccountingZuite_reportMacros/macros/check_row_in_balance_table" />
</tal:block>
<tal:block tal:define="row_selector string:$${table}/tbody/tr[3];
node_id string:A-EQUITY;
node_title string:Equity">
<tal:block metal:use-macro="here/AccountingZuite_reportMacros/macros/check_row_in_balance_table" />
node_title string:Stocks;
node_id string:3">
<tal:block metal:use-macro="here/AccountingZuite_reportMacros/macros/check_row_in_balance_table"></tal:block>
</tal:block>
<tal:block tal:define="row_selector string:$${table}/tbody/tr[4];
node_id string:A-FIX-ASSETS;
node_title string:Fixed Assets">
<tal:block metal:use-macro="here/AccountingZuite_reportMacros/macros/check_row_in_balance_table" />
</tal:block>
<tal:block tal:define="row_selector string:$${table}/tbody/tr[5];
node_id string:A-GP;
node_title string:Goods Purchase">
<tal:block metal:use-macro="here/AccountingZuite_reportMacros/macros/check_row_in_balance_table" />
</tal:block>
<tal:block tal:define="row_selector string:$${table}/tbody/tr[6];
node_id string:A-GS;
node_title string:Goods Sales">
<tal:block metal:use-macro="here/AccountingZuite_reportMacros/macros/check_row_in_balance_table" />
</tal:block>
<tal:block tal:define="row_selector string:$${table}/tbody/tr[7];
node_id string:A-PAY;
node_id string:40;
node_title string:Payable;
debit string:200;
credit string:100;
......@@ -138,8 +133,8 @@ Copy of unittest <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product
<tal:block metal:use-macro="here/AccountingZuite_reportMacros/macros/check_row_in_balance_table" />
</tal:block>
<tal:block tal:define="row_selector string:$${table}/tbody/tr[8];
node_id string:A-REC;
<tal:block tal:define="row_selector string:$${table}/tbody/tr[5];
node_id string:41;
node_title string:Receivable;
debit string:3400;
credit string:200;
......@@ -150,16 +145,38 @@ Copy of unittest <a href="https://lab.nexedi.com/nexedi/erp5/blob/master/product
<tal:block metal:use-macro="here/AccountingZuite_reportMacros/macros/check_row_in_balance_table" />
</tal:block>
<tal:block tal:define="row_selector string:$${table}/tbody/tr[9];
<tal:block tal:define="row_selector string:$${table}/tbody/tr[6];
node_title string:Refundable VAT 10%;
node_id string:A-REF-VAT">
node_id string:4456">
<tal:block metal:use-macro="here/AccountingZuite_reportMacros/macros/check_row_in_balance_table"></tal:block>
</tal:block>
<tal:block tal:define="row_selector string:$${table}/tbody/tr[7];
node_id string:4457;
node_title string:Collected VAT 10%">
<tal:block metal:use-macro="here/AccountingZuite_reportMacros/macros/check_row_in_balance_table" />
</tal:block>
<tal:block tal:define="row_selector string:$${table}/tbody/tr[8];
node_id string:5;
node_title string:Bank (Bank1);
credit string:3300;
final_balance string:-3300;
final_credit_balance string:3300;
final_balance_if_credit string:3300">
<tal:block metal:use-macro="here/AccountingZuite_reportMacros/macros/check_row_in_balance_table" />
</tal:block>
<tal:block tal:define="row_selector string:$${table}/tbody/tr[9];
node_id string:6;
node_title string:Goods Purchase">
<tal:block metal:use-macro="here/AccountingZuite_reportMacros/macros/check_row_in_balance_table" />
</tal:block>
<tal:block tal:define="row_selector string:$${table}/tbody/tr[10];
node_title string:Stocks;
node_id string:A-STOCK">
<tal:block metal:use-macro="here/AccountingZuite_reportMacros/macros/check_row_in_balance_table"></tal:block>
node_id string:7;
node_title string:Goods Sales">
<tal:block metal:use-macro="here/AccountingZuite_reportMacros/macros/check_row_in_balance_table" />
</tal:block>
<!-- Stats line -->
......
erp5_full_text_mroonga_catalog
erp5_dummy_movement
\ No newline at end of file
erp5_dummy_movement
erp5_ods_style
\ No newline at end of file
......@@ -9,6 +9,10 @@ def Base_aqBase(self):
def Base_aqInner(self):
return aq_inner(self)
def Portal_abortTransaction(self):
import transaction
transaction.abort()
def Field_getSubFieldKeyDict(self, field, field_id, key=None):
"""XXX"""
return field.generate_subfield_key(field_id, key=key)
......
"""
This script factorises code required to redirect to the appropriate
page from a script. It should probably be extended, reviewed and documented
so that less code is copied and pasted in dialog scripts.
"""UI Script to redirect the user to `context` with optional custom view `form_id`.
TODO: improve API and extensively document. ERP5Site_redirect may
be redundant.
:param keep_items: is used mainly to pass "portal_status_message" to be showed to the user
the new UI supports "portal_status_level" with values "success" or "error"
"""
from ZTUtils import make_query
import json
if abort_transaction:
# Old UI simply throws a Redirect exception and Published does its job
# but we cannot use it here so we abort using External Method
context.getPortalObject().Portal_abortTransaction()
request_form = context.REQUEST.form
request_form.update(kw)
request_form = context.ERP5Site_filterParameterList(request_form)
......@@ -40,8 +42,16 @@ response.setHeader("X-Location", "urn:jio:get:%s" % context.getRelativeUrl())
# therefor we don't need to be afraid of clashes
response.setHeader("Content-type", "application/json; charset=utf-8")
portal_status_level = keep_items.pop("portal_status_level", "success")
if portal_status_level in ("warning", "error", "fatal"):
portal_status_level = "error"
if portal_status_level in ("info", "debug", "success"):
portal_status_level = "success"
result_dict = {
'portal_status_message': "%s" % keep_items.pop("portal_status_message", ""),
'portal_status_level': "%s" % portal_status_level,
'_links': {
"self": {
# XXX Include query parameters
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>form_id=\'view\', keep_items={}, **kw</string> </value>
<value> <string>form_id=\'view\', keep_items={}, abort_transaction=False, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>Portal_abortTransaction</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>HalStyle</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Portal_abortTransaction</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Abort Current Transaction</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment