Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
b62da16d
Commit
b62da16d
authored
Nov 16, 2017
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bank_reconciliation: review sanity check assertion
It did not support reconciled internal transactions
parent
f666e738
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
8 deletions
+23
-8
bt5/erp5_bank_reconciliation/SkinTemplateItem/portal_skins/erp5_bank_reconciliation/BankReconciliation_reconcileTransactionList.py
...nciliation/BankReconciliation_reconcileTransactionList.py
+23
-8
No files found.
bt5/erp5_bank_reconciliation/SkinTemplateItem/portal_skins/erp5_bank_reconciliation/BankReconciliation_reconcileTransactionList.py
View file @
b62da16d
...
@@ -5,17 +5,32 @@ portal = context.getPortalObject()
...
@@ -5,17 +5,32 @@ portal = context.getPortalObject()
portal
.
portal_selections
.
updateSelectionCheckedUidList
(
list_selection_name
,
listbox_uid
,
uids
)
portal
.
portal_selections
.
updateSelectionCheckedUidList
(
list_selection_name
,
listbox_uid
,
uids
)
selection_uid_list
=
portal
.
portal_selections
.
getSelectionCheckedUidsFor
(
list_selection_name
)
selection_uid_list
=
portal
.
portal_selections
.
getSelectionCheckedUidsFor
(
list_selection_name
)
reconciled_bank_account
=
context
.
getSourcePayment
()
if
mode
==
'reconcile'
:
if
mode
==
'reconcile'
:
for
line
in
portal
.
portal_catalog
(
uid
=
selection_uid_list
or
-
1
):
for
line
in
portal
.
portal_catalog
(
uid
=
selection_uid_list
or
-
1
):
line
=
line
.
getObject
()
line
=
line
.
getObject
()
if
line
.
getAggregate
(
portal_type
=
'Bank Reconciliation'
):
# Sanity check: line should not already be reconciled.
return
context
.
Base_redirect
(
dialog_id
,
# But what can happen is that this line is an internal transaction line that was
abort_transaction
=
True
,
# reconciled for payment on one side but not yet on the other side (ex. reconciled
keep_items
=
{
'portal_status_message'
:
translateString
(
"Line Already Reconciled"
),
# for the bank account used as source_payment, not not bank account used at
'reset'
:
1
,
# destination_payment). So we can accept if the line is already reconciled with a
'cancel_url'
:
cancel_url
,
# bank reconciliation, if that bank reconciliation is using another bank account
'mode'
:
mode
,
# that the one on this bank reconciliation.
'field_your_mode'
:
mode
})
# To prevent unauthorized errors, we only consider bank reconciliation users can access.
for
existing_bank_reconciliation
in
line
.
getAggregateValueList
(
portal_type
=
'Bank Reconciliation'
,
checked_permission
=
'Access contents information'
):
if
existing_bank_reconciliation
.
getSourcePayment
()
==
reconciled_bank_account
:
return
context
.
Base_redirect
(
dialog_id
,
abort_transaction
=
True
,
keep_items
=
{
'portal_status_message'
:
translateString
(
"Line Already Reconciled"
),
'reset'
:
1
,
'cancel_url'
:
cancel_url
,
'mode'
:
mode
,
'field_your_mode'
:
mode
})
line
.
AccountingTransactionLine_setBankReconciliation
(
context
,
line
.
AccountingTransactionLine_setBankReconciliation
(
context
,
message
=
translateString
(
"Reconciling Bank Line"
))
message
=
translateString
(
"Reconciling Bank Line"
))
return
context
.
Base_redirect
(
dialog_id
,
keep_items
=
{
return
context
.
Base_redirect
(
dialog_id
,
keep_items
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment