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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
cd53bf06
Commit
cd53bf06
authored
Oct 13, 2023
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accounting: set status to error when grouping and nothing matches
parent
574aafdb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_setGroupingReference.py
...nting/AccountingTransactionModule_setGroupingReference.py
+7
-5
bt5/erp5_accounting_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_accounting_report_zuite/test_grouping_reference/test_group_from_account_transaction_list.html.zpt
...ference/test_group_from_account_transaction_list.html.zpt
+1
-1
No files found.
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_setGroupingReference.py
View file @
cd53bf06
...
...
@@ -4,7 +4,8 @@ Used as a fast input dialog action.
from
Products.CMFCore.WorkflowCore
import
WorkflowException
portal
=
context
.
getPortalObject
()
Base_translateString
=
portal
.
Base_translateString
psm
=
Base_translateString
(
'Nothing matches.'
)
portal_status_message
=
Base_translateString
(
'Nothing matches.'
)
portal_status_level
=
'error'
request
=
container
.
REQUEST
# update selected uids
...
...
@@ -54,8 +55,9 @@ if grouping == 'grouping':
grouped_line_list
=
context
.
AccountingTransaction_guessGroupedLines
(
accounting_transaction_line_uid_list
=
uids
)
if
grouped_line_list
:
p
sm
=
Base_translateString
(
'${grouped_line_count} lines grouped.'
,
p
ortal_status_message
=
Base_translateString
(
'${grouped_line_count} lines grouped.'
,
mapping
=
dict
(
grouped_line_count
=
len
(
grouped_line_list
)))
portal_status_level
=
'success'
# make sure nothing will be checked next time
portal
.
portal_selections
.
setSelectionCheckedUidsFor
(
list_selection_name
,
[])
...
...
@@ -121,14 +123,14 @@ else:
# to know the number of ungrouped lines.
ungrouped_line_list
.
extend
(
line
.
AccountingTransactionLine_resetGroupingReference
(
async
=
False
))
p
sm
=
Base_translateString
(
'${ungrouped_line_count} lines ungrouped.'
,
p
ortal_status_message
=
Base_translateString
(
'${ungrouped_line_count} lines ungrouped.'
,
mapping
=
dict
(
ungrouped_line_count
=
len
(
ungrouped_line_list
)))
portal_status_level
=
'success'
# make sure nothing will be checked next time
portal
.
portal_selections
.
setSelectionCheckedUidsFor
(
list_selection_name
,
[])
return
context
.
Base_renderForm
(
'AccountingTransactionModule_viewGroupingFastInputDialog'
,
REQUEST
=
request
,
keep_items
=
{
'portal_status_message'
:
p
sm
}
keep_items
=
{
'portal_status_message'
:
p
ortal_status_message
,
'portal_status_level'
:
portal_status_level
}
)
bt5/erp5_accounting_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_accounting_report_zuite/test_grouping_reference/test_group_from_account_transaction_list.html.zpt
View file @
cd53bf06
...
...
@@ -87,7 +87,7 @@ Grouping from account transaction view
<!-- Not possible to group for now -->
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded"
/>
<tal:block
tal:define=
"notification_configuration python: {'class': '
success
',
<tal:block
tal:define=
"notification_configuration python: {'class': '
error
',
'text': 'Nothing matches.'}"
>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification"
/>
</tal:block>
...
...
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