Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Romain Courteaud
slapos.core
Commits
760a6811
Commit
760a6811
authored
Sep 15, 2023
by
Romain Courteaud
🐙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: do not count all Support Requests
limit parameter with count is meaningless, as count return 1 result
parent
602bbacc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/ERP5Site_isSupportRequestCreationClosed.py
...crm_monitoring/ERP5Site_isSupportRequestCreationClosed.py
+10
-9
No files found.
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/ERP5Site_isSupportRequestCreationClosed.py
View file @
760a6811
...
...
@@ -2,19 +2,20 @@ from Products.ERP5Type.Cache import CachingMethod
portal
=
context
.
getPortalObject
()
def
isSupportRequestCreationClosed
(
destination_decision
=
None
):
limit
=
portal
.
portal_preferences
.
getPreferredSupportRequestCreationLimit
(
5
)
limit
=
int
(
portal
.
portal_preferences
.
getPreferredSupportRequestCreationLimit
(
5
)
)
kw
=
{}
kw
[
'limit'
]
=
limit
kw
[
'portal_type'
]
=
'Support Request'
kw
[
'simulation_state'
]
=
[
"validated"
,
"submitted"
]
kw
[
'default_resource_uid'
]
=
portal
.
service_module
.
slapos_crm_monitoring
.
getUid
()
kw
=
{
'limit'
:
limit
,
'portal_type'
:
'Support Request'
,
'simulation_state'
:
[
"validated"
,
"submitted"
],
'resource__uid'
:
portal
.
service_module
.
slapos_crm_monitoring
.
getUid
()
}
if
destination_decision
:
kw
[
'de
fault_destination_decision
_uid'
]
=
context
.
restrictedTraverse
(
kw
[
'de
stination_decision_
_uid'
]
=
context
.
restrictedTraverse
(
destination_decision
).
getUid
()
support_request_amount
=
context
.
portal_catalog
.
countResults
(
**
kw
)[
0
][
0
]
return
support_request_amount
>=
int
(
limi
t
)
support_request_amount
_list
=
context
.
portal_catalog
(
**
kw
)
return
limit
<=
len
(
support_request_amount_lis
t
)
return
CachingMethod
(
isSupportRequestCreationClosed
,
...
...
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