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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
erp5
Commits
29e138eb
Commit
29e138eb
authored
May 14, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_open_trade: support case where stop_date is defined
parent
f1e902b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
bt5/erp5_open_trade/SkinTemplateItem/portal_skins/erp5_open_trade/OpenOrder_updateSimulation.py
...ortal_skins/erp5_open_trade/OpenOrder_updateSimulation.py
+15
-4
No files found.
bt5/erp5_open_trade/SkinTemplateItem/portal_skins/erp5_open_trade/OpenOrder_updateSimulation.py
View file @
29e138eb
...
...
@@ -12,8 +12,19 @@ for open_order_line in context.objectValues():
if
getattr
(
item
.
aq_explicit
,
'updateSimulation'
,
None
)
is
not
None
and
\
item
not
in
subscription_item_set
:
subscription_item_set
.
add
(
item
)
# If start_date is in futur, do not look for unreachable period
stop_date
=
item
.
getNextPeriodicalDate
(
max
(
now
,
ob
.
getStartDate
()))
# Logic duplicated from SubscriptionItem.py
start_date
=
ob
.
getStartDate
()
# if there is no stop_date, block the generation
# to today
stop_date
=
ob
.
getStopDate
()
current_date
=
start_date
if
(
start_date
==
stop_date
)
or
(
stop_date
is
None
):
# stop_date seems acquired from start_date
stop_date
=
now
while
current_date
<
stop_date
:
current_date
=
item
.
getNextPeriodicalDate
(
current_date
)
# Do not expand subscription item if there is
# no new simulation movement to create
# (expand always reindex the full simulation tree,
...
...
@@ -21,8 +32,8 @@ for open_order_line in context.objectValues():
simulation_movement_list
=
portal
.
portal_simulation
.
getMovementHistoryList
(
portal_type
=
'Simulation Movement'
,
aggregate__uid
=
item
.
getUid
(),
from_date
=
stop
_date
,
at_date
=
stop
_date
,
from_date
=
current
_date
,
at_date
=
current
_date
,
only_accountable
=
False
,
)
if
len
(
simulation_movement_list
)
==
0
:
...
...
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