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
44a604bb
Commit
44a604bb
authored
Sep 22, 2016
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
acknowledgement tool: getUnreadDocumentUrlList was return also draft documents by mistake
parent
fae19bf9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
product/ERP5/Tool/AcknowledgementTool.py
product/ERP5/Tool/AcknowledgementTool.py
+8
-1
product/ERP5/tests/testAcknowledgementTool.py
product/ERP5/tests/testAcknowledgementTool.py
+9
-2
No files found.
product/ERP5/Tool/AcknowledgementTool.py
View file @
44a604bb
...
@@ -70,6 +70,13 @@ class AcknowledgementTool(BaseTool):
...
@@ -70,6 +70,13 @@ class AcknowledgementTool(BaseTool):
"""
"""
return
len
(
self
.
getUnreadAcknowledgementList
(
*
args
,
**
kw
))
return
len
(
self
.
getUnreadAcknowledgementList
(
*
args
,
**
kw
))
def
_getAcknowledgementTypeList
(
self
):
"""
Return list of acknowledgement types, should use portal types group
when we see need of having several portal types for acknowledgements
"""
return
(
'Acknowledgement'
,)
security
.
declarePublic
(
'getUnreadAcknowledgementList'
)
security
.
declarePublic
(
'getUnreadAcknowledgementList'
)
def
getUnreadAcknowledgementList
(
self
,
portal_type
=
None
,
user_name
=
None
,
def
getUnreadAcknowledgementList
(
self
,
portal_type
=
None
,
user_name
=
None
,
url_list
=
None
):
url_list
=
None
):
...
@@ -131,7 +138,7 @@ class AcknowledgementTool(BaseTool):
...
@@ -131,7 +138,7 @@ class AcknowledgementTool(BaseTool):
# so not in a final state
# so not in a final state
final_state_list
=
self
.
getPortalCurrentInventoryStateList
()
final_state_list
=
self
.
getPortalCurrentInventoryStateList
()
query
=
NegatedQuery
(
Query
(
simulation_state
=
final_state_list
))
query
=
NegatedQuery
(
Query
(
simulation_state
=
final_state_list
))
for
x
in
self
.
portal_catalog
(
portal_type
=
portal_type
,
for
x
in
self
.
portal_catalog
(
portal_type
=
self
.
_getAcknowledgementTypeList
()
,
query
=
query
,
query
=
query
,
# start_date = {'query':now,'range':'max'},
# start_date = {'query':now,'range':'max'},
# stop_date = {'query':now,'range':'min'},
# stop_date = {'query':now,'range':'min'},
...
...
product/ERP5/tests/testAcknowledgementTool.py
View file @
44a604bb
...
@@ -60,13 +60,20 @@ class TestAcknowledgementTool(ERP5TypeTestCase):
...
@@ -60,13 +60,20 @@ class TestAcknowledgementTool(ERP5TypeTestCase):
title
=
"foo"
,
title
=
"foo"
,
start_date
=
now
-
2
,
start_date
=
now
-
2
,
stop_date
=
now
+
2
)
stop_date
=
now
+
2
)
portal
.
portal_workflow
.
doActionFor
(
event
,
'start_action'
)
self
.
assertEqual
(
event
.
getSimulationState
(),
'started'
)
self
.
tic
()
self
.
tic
()
acknowledgement_tool_kw
=
{}
acknowledgement_tool_kw
=
{}
acknowledgement_tool_kw
[
'user_name'
]
=
'seb'
acknowledgement_tool_kw
[
'user_name'
]
=
'seb'
acknowledgement_tool_kw
[
'portal_type'
]
=
event_type
acknowledgement_tool_kw
[
'portal_type'
]
=
event_type
# draft document must be not be part of acknowledgements
document_url_list
=
portal
.
portal_acknowledgements
\
.
getUnreadDocumentUrlList
(
**
acknowledgement_tool_kw
)
self
.
assertFalse
(
event
.
getRelativeUrl
()
in
document_url_list
)
# validated document must be part of acknowledgements
portal
.
portal_workflow
.
doActionFor
(
event
,
'start_action'
)
self
.
assertEqual
(
event
.
getSimulationState
(),
'started'
)
self
.
tic
()
document_url_list
=
portal
.
portal_acknowledgements
\
document_url_list
=
portal
.
portal_acknowledgements
\
.
getUnreadDocumentUrlList
(
**
acknowledgement_tool_kw
)
.
getUnreadDocumentUrlList
(
**
acknowledgement_tool_kw
)
self
.
assertTrue
(
event
.
getRelativeUrl
()
in
document_url_list
)
self
.
assertTrue
(
event
.
getRelativeUrl
()
in
document_url_list
)
...
...
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