Commit a5dcb27b authored by Romain Courteaud's avatar Romain Courteaud

[erp5_accounting] WIP: uids are deprecated

parent 0bf19426
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
<value> <value>
<tuple> <tuple>
<string>action_type/object_button</string> <string>action_type/object_jio_button</string>
</tuple> </tuple>
</value> </value>
</item> </item>
<item> <item>
<key> <string>category</string> </key> <key> <string>category</string> </key>
<value> <string>object_button</string> </value> <value> <string>object_jio_button</string> </value>
</item> </item>
<item> <item>
<key> <string>condition</string> </key> <key> <string>condition</string> </key>
......
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
<value> <value>
<tuple> <tuple>
<string>action_type/object_exchange</string> <string>action_type/object_jio_exchange</string>
</tuple> </tuple>
</value> </value>
</item> </item>
<item> <item>
<key> <string>category</string> </key> <key> <string>category</string> </key>
<value> <string>object_exchange</string> </value> <value> <string>object_jio_exchange</string> </value>
</item> </item>
<item> <item>
<key> <string>condition</string> </key> <key> <string>condition</string> </key>
......
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
<value> <value>
<tuple> <tuple>
<string>action_type/object_action</string> <string>action_type/object_jio_action</string>
</tuple> </tuple>
</value> </value>
</item> </item>
<item> <item>
<key> <string>category</string> </key> <key> <string>category</string> </key>
<value> <string>object_action</string> </value> <value> <string>object_jio_action</string> </value>
</item> </item>
<item> <item>
<key> <string>condition</string> </key> <key> <string>condition</string> </key>
......
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
<value> <value>
<tuple> <tuple>
<string>action_type/object_action</string> <string>action_type/object_jio_action</string>
</tuple> </tuple>
</value> </value>
</item> </item>
<item> <item>
<key> <string>category</string> </key> <key> <string>category</string> </key>
<value> <string>object_action</string> </value> <value> <string>object_jio_action</string> </value>
</item> </item>
<item> <item>
<key> <string>condition</string> </key> <key> <string>condition</string> </key>
......
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
<value> <value>
<tuple> <tuple>
<string>action_type/object_button</string> <string>action_type/object_jio_button</string>
</tuple> </tuple>
</value> </value>
</item> </item>
<item> <item>
<key> <string>category</string> </key> <key> <string>category</string> </key>
<value> <string>object_button</string> </value> <value> <string>object_jio_button</string> </value>
</item> </item>
<item> <item>
<key> <string>condition</string> </key> <key> <string>condition</string> </key>
......
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
<value> <value>
<tuple> <tuple>
<string>action_type/object_button</string> <string>action_type/object_jio_button</string>
</tuple> </tuple>
</value> </value>
</item> </item>
<item> <item>
<key> <string>category</string> </key> <key> <string>category</string> </key>
<value> <string>object_button</string> </value> <value> <string>object_jio_button</string> </value>
</item> </item>
<item> <item>
<key> <string>condition</string> </key> <key> <string>condition</string> </key>
......
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
<value> <value>
<tuple> <tuple>
<string>action_type/object_button</string> <string>action_type/object_jio_button</string>
</tuple> </tuple>
</value> </value>
</item> </item>
<item> <item>
<key> <string>category</string> </key> <key> <string>category</string> </key>
<value> <string>object_button</string> </value> <value> <string>object_jio_button</string> </value>
</item> </item>
<item> <item>
<key> <string>condition</string> </key> <key> <string>condition</string> </key>
......
...@@ -4,9 +4,13 @@ portal = context.getPortalObject() ...@@ -4,9 +4,13 @@ portal = context.getPortalObject()
countMessage = portal.portal_activities.countMessage countMessage = portal.portal_activities.countMessage
invoice_type_list = portal.getPortalInvoiceTypeList() invoice_type_list = portal.getPortalInvoiceTypeList()
portal.portal_selections.updateSelectionCheckedUidList(selection_name, listbox_uid, uids) if selection_name:
selection_uid_list = portal.portal_selections.getSelectionCheckedUidsFor( portal.portal_selections.updateSelectionCheckedUidList(selection_name, listbox_uid, uids)
selection_name) selection_uid_list = portal.portal_selections.getSelectionCheckedUidsFor(
selection_name)
else:
selection_uid_list = uids
if selection_uid_list: if selection_uid_list:
object_list = [brain.getObject() for brain in portal.portal_catalog(uid=selection_uid_list)] object_list = [brain.getObject() for brain in portal.portal_catalog(uid=selection_uid_list)]
else: else:
...@@ -20,10 +24,9 @@ portal.portal_selections.setSelectionParamsFor('accounting_create_related_paymen ...@@ -20,10 +24,9 @@ portal.portal_selections.setSelectionParamsFor('accounting_create_related_paymen
# XXX prevent to call this on the whole module: # XXX prevent to call this on the whole module:
if len(object_list) >= 1000: if len(object_list) >= 1000:
return context.Base_redirect( return context.Base_renderMessage(
form_id, translateString('Refusing to process more than 1000 objects, check your selection.'),
keep_items={'portal_status_message': translateString( 'warning')
'Refusing to process more than 1000 objects, check your selection.')})
tag = 'payment_creation_%s' % random.randint(0, 1000) tag = 'payment_creation_%s' % random.randint(0, 1000)
activated = 0 activated = 0
......
...@@ -8,11 +8,13 @@ psm = Base_translateString('Nothing matches.') ...@@ -8,11 +8,13 @@ psm = Base_translateString('Nothing matches.')
request = container.REQUEST request = container.REQUEST
# update selected uids # update selected uids
portal.portal_selections.updateSelectionCheckedUidList( if list_selection_name:
list_selection_name, uids=uids, listbox_uid=listbox_uid, REQUEST=request) portal.portal_selections.updateSelectionCheckedUidList(
uids = portal.portal_selections.getSelectionCheckedUidsFor(list_selection_name) 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 ? # XXX when should it be validated ?
# Kato: It is already validated because this is Form Dialog script
if node == '': if node == '':
node = context.REQUEST.get('field_your_node', node) node = context.REQUEST.get('field_your_node', node)
if mirror_section == '': if mirror_section == '':
...@@ -22,13 +24,13 @@ if grouping == '': ...@@ -22,13 +24,13 @@ if grouping == '':
grouping = request.get('your_grouping', grouping = request.get('your_grouping',
request.get('field_your_grouping', request.get('field_your_grouping',
grouping)) grouping))
if list_selection_name:
# edit selection for dialog parameters # edit selection for dialog parameters
portal.portal_selections.setSelectionParamsFor( portal.portal_selections.setSelectionParamsFor(
'grouping_reference_fast_input_selection', 'grouping_reference_fast_input_selection',
params=dict(node=node, params=dict(node=node,
grouping=grouping, grouping=grouping,
mirror_section=mirror_section)) mirror_section=mirror_section))
# calculate total selected amount # calculate total selected amount
total_selected_amount = 0 total_selected_amount = 0
...@@ -42,9 +44,9 @@ if uids: ...@@ -42,9 +44,9 @@ if uids:
request.set('total_selected_amount', total_selected_amount) request.set('total_selected_amount', total_selected_amount)
if update: if update:
request.set('portal_status_message', Base_translateString('Updated')) return context.Base_renderForm('AccountingTransactionModule_viewGroupingFastInputDialog',
return context.AccountingTransactionModule_viewGroupingFastInputDialog(request) keep_items={'portal_status_message': Base_translateString('Updated')})
# otherwise, try to group... # otherwise, try to group...
if grouping == 'grouping': if grouping == 'grouping':
...@@ -53,9 +55,9 @@ if grouping == 'grouping': ...@@ -53,9 +55,9 @@ if grouping == 'grouping':
if grouped_line_list: if grouped_line_list:
psm = Base_translateString('${grouped_line_count} lines grouped.', psm = Base_translateString('${grouped_line_count} lines grouped.',
mapping=dict(grouped_line_count=len(grouped_line_list))) mapping=dict(grouped_line_count=len(grouped_line_list)))
if list_selection_name:
# make sure nothing will be checked next time # make sure nothing will be checked next time
portal.portal_selections.setSelectionCheckedUidsFor(list_selection_name, []) portal.portal_selections.setSelectionCheckedUidsFor(list_selection_name, [])
# we check if we can mark some transaction as payed. # we check if we can mark some transaction as payed.
transaction_list = {} transaction_list = {}
...@@ -119,8 +121,9 @@ else: ...@@ -119,8 +121,9 @@ else:
psm = Base_translateString('${ungrouped_line_count} lines ungrouped.', psm = Base_translateString('${ungrouped_line_count} lines ungrouped.',
mapping=dict(ungrouped_line_count=len(ungrouped_line_list))) mapping=dict(ungrouped_line_count=len(ungrouped_line_list)))
# make sure nothing will be checked next time if list_selection_name:
portal.portal_selections.setSelectionCheckedUidsFor(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.Base_renderForm('AccountingTransactionModule_viewGroupingFastInputDialog',
return context.AccountingTransactionModule_viewGroupingFastInputDialog(request) keep_items={'portal_status_message': psm})
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