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