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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Amer
erp5
Commits
1ce8b738
Commit
1ce8b738
authored
May 05, 2014
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5/PresencePeriod: allow to customize the place to find calendar period exceptions
parent
7b427184
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
product/ERP5/Document/PresencePeriod.py
product/ERP5/Document/PresencePeriod.py
+16
-1
No files found.
product/ERP5/Document/PresencePeriod.py
View file @
1ce8b738
...
...
@@ -113,13 +113,28 @@ class PresencePeriod(Movement, PeriodicityMixin):
result
.
append
(
self
.
asContext
(
self
,
**
period_data
))
return
result
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getExceptionValueList'
)
def
getCalendarPeriodExceptionValueList
(
self
):
"""
Return a list of objects that allows te define exception to the
current presence period. It could be used for particular
planned unavailability like banking holidays.
"""
method
=
self
.
_getTypeBasedMethod
(
"getCalendarPeriodExceptionValueList"
)
if
method
is
None
:
exception_list
=
self
.
contentValues
(
portal_type
=
"Calendar Exception"
)
else
:
exception_list
=
method
()
return
exception_list
def
_getDatePeriodDataList
(
self
):
"""
Get all periods between periodicity start date
and periodicity stop date
"""
result
=
[]
exception_value_list
=
self
.
contentValues
(
portal_type
=
"Calendar Exception"
)
exception_value_list
=
self
.
getCalendarPeriodExceptionValueList
(
)
exception_date_list
=
[
x
.
getExceptionDate
()
\
for
x
in
exception_value_list
]
exception_date_list
=
[
x
for
x
in
exception_date_list
if
x
is
not
None
]
...
...
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