Commit 6050da0d authored by Jérome Perrin's avatar Jérome Perrin

accounting, bank_reconciliation, payment_mean: only show validated bank accounts

drop skip_invalidated_bank_accounts option, we are now using
base_category instead.
parent 6ce41dba
"""Returns an item list of the acceptable bank accounts.
If `organisation` is passed, then we only show bank accounts available for that
organisation, using the following policy:
- if organisation is independant accounting entity (ie. have accounting periods),
- if organisation is independent accounting entity (ie. have accounting periods),
only bank accounts from this organisation can be selected
- otherwise, bank accounts from this organisation and all organisation directly
members of the parent groups can be us
......@@ -16,14 +16,15 @@ base_category is anyway included.
"""
portal = context.getPortalObject()
search_kw = dict(portal_type=portal.getPortalPaymentNodeTypeList())
if skip_invalidated_bank_accounts:
search_kw['validation_state'] = '!=invalidated'
search_kw = dict(
portal_type=portal.getPortalPaymentNodeTypeList(),
validation_state='validated',
)
if organisation:
organisation_value = portal.restrictedTraverse(organisation)
# if organisation is an independant accounting section and contains bank accounts,
# if organisation is an independent accounting section and contains bank accounts,
# only take into account those.
if organisation_value == organisation_value.Organisation_getMappingRelatedOrganisation():
bank_account_list = organisation_value.searchFolder(**search_kw)
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>organisation=None, skip_invalidated_bank_accounts=0, section_category=None, section_category_strict_membership=False, base_category=None</string> </value>
<value> <string>organisation=None, section_category=None, section_category_strict_membership=False, base_category=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
return context.AccountModule_getBankAccountItemList(
organisation=context.getDestinationSection(),
base_category='destination_payment',
skip_invalidated_bank_accounts=
(context.getSimulationState() != 'delivered'))
base_category='destination_payment')
return context.AccountModule_getBankAccountItemList(
organisation=context.getSourceSection(),
base_category='source_payment',
skip_invalidated_bank_accounts=
(context.getSimulationState() != 'delivered'))
base_category='source_payment')
......@@ -118,7 +118,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: context.AccountModule_getBankAccountItemList(organisation=context.getSourceSection(), skip_invalidated_bank_accounts=(context.getValidationState() != \'validated\'))</string> </value>
<value> <string>python: context.AccountModule_getBankAccountItemList(organisation=context.getSourceSection(), base_category=\'source_payment\')</string> </value>
</item>
</dictionary>
</pickle>
......
return context.AccountModule_getBankAccountItemList(
organisation=context.getSourceSection(),
base_category='source_payment',
skip_invalidated_bank_accounts=
(context.getValidationState() != 'delivered'))
base_category='source_payment')
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