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
139
Merge Requests
139
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
00c4a1f3
Commit
00c4a1f3
authored
Mar 19, 2020
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MonthlyRangeMovementGroup: set an appropriate time offset at the end of month.
parent
5340aacb
Pipeline
#8480
failed with stage
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.MonthlyRangeMovementGroup.py
...tal_components/document.erp5.MonthlyRangeMovementGroup.py
+4
-1
No files found.
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.MonthlyRangeMovementGroup.py
View file @
00c4a1f3
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
##############################################################################
##############################################################################
from
erp5.component.document.MovementGroup
import
MovementGroup
from
erp5.component.document.MovementGroup
import
MovementGroup
from
DateTime
import
DateTime
from
Products.ERP5Type.DateUtils
import
atTheEndOfPeriod
from
Products.ERP5Type.DateUtils
import
atTheEndOfPeriod
...
@@ -48,7 +49,9 @@ class MonthlyRangeMovementGroup(MovementGroup):
...
@@ -48,7 +49,9 @@ class MonthlyRangeMovementGroup(MovementGroup):
for
property_name
in
self
.
getTestedPropertyList
()
or
(
'start_date'
,
'stop_date'
):
for
property_name
in
self
.
getTestedPropertyList
()
or
(
'start_date'
,
'stop_date'
):
date
=
movement
.
getProperty
(
property_name
,
None
)
date
=
movement
.
getProperty
(
property_name
,
None
)
if
date
is
not
None
:
if
date
is
not
None
:
end_of_month
=
atTheEndOfPeriod
(
date
,
'month'
)
-
1
# wrap atTheEndOfPeriod value with DateTime(value..strftime('%Y/%m/%d')) so that
# it returns a value with an appropriate time offset at that date.
end_of_month
=
DateTime
((
atTheEndOfPeriod
(
date
,
'month'
)
-
0.5
).
strftime
(
'%Y/%m/%d'
))
property_dict
[
property_name
]
=
end_of_month
property_dict
[
property_name
]
=
end_of_month
return
property_dict
return
property_dict
...
...
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