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
138
Merge Requests
138
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
1ec72363
Commit
1ec72363
authored
Mar 12, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop periodicity, as it does not support exact month additions.
Do not expand on equal dates too.
parent
2f05fe1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
product/ERP5/Document/SubscriptionItem.py
product/ERP5/Document/SubscriptionItem.py
+5
-2
No files found.
product/ERP5/Document/SubscriptionItem.py
View file @
1ec72363
...
...
@@ -39,6 +39,7 @@ from Products.ERP5.mixin.rule import MovementGeneratorMixin
from
Products.ERP5.mixin.periodicity
import
PeriodicityMixin
from
Products.ERP5Type.UnrestrictedMethod
import
UnrestrictedMethod
from
Products.ERP5Type.Base
import
Base
from
Products.ERP5Type.DateUtils
import
getNumberOfDayInMonth
from
zLOG
import
LOG
...
...
@@ -281,7 +282,7 @@ class SubscriptionItem(Item, CompositionMixin, MovementGeneratorMixin, Periodici
resource
=
movement
.
getResource
()
start_date
=
movement
.
getStartDate
()
stop_date
=
movement
.
getStopDate
()
if
start_date
is
None
or
stop_date
is
None
or
start_date
>
stop_date
:
if
start_date
is
None
or
stop_date
is
None
or
start_date
>
=
stop_date
:
# infinity nor time back machine does not exist
continue
source
=
movement
.
getSource
()
...
...
@@ -302,7 +303,9 @@ class SubscriptionItem(Item, CompositionMixin, MovementGeneratorMixin, Periodici
current_date
=
start_date
id_index
=
0
while
current_date
<
stop_date
:
next_date
=
self
.
getNextPeriodicalDate
(
current_date
)
# XXX-Luke: Periodicty usage was dropped as real month additions shall
# be supported, when periodicity floors result to given period precision
next_date
=
current_date
+
getNumberOfDayInMonth
(
current_date
)
if
next_date
>
stop_date
:
next_date
=
stop_date
generated_movement
=
newTempMovement
(
self
,
'subscription_%s'
%
id_index
)
...
...
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