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
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
Titouan Soulard
slapos.core
Commits
105ee149
Commit
105ee149
authored
Jun 14, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_subscription_request: do not set the stop_date on the open order
parent
4f0438a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
6 deletions
+20
-6
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_createOpenSaleOrder.py
...iption_request/SubscriptionRequest_createOpenSaleOrder.py
+20
-6
No files found.
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_createOpenSaleOrder.py
View file @
105ee149
...
...
@@ -34,14 +34,18 @@ hosting_subscription.validate()
#######################################################
# Open Sale Order
start_date
=
hosting_subscription
.
HostingSubscription_calculateSubscriptionStartDate
()
open_sale_order
=
portal
.
open_sale_order_module
.
newContent
(
portal_type
=
"Open Sale Order"
,
current_date
=
getClosestDate
(
target_date
=
hosting_subscription
.
getCreationDate
(),
precision
=
'day'
)
next_period_date
=
hosting_subscription
.
getNextPeriodicalDate
(
current_date
)
if
subscription_request
.
getQuantityUnit
()
==
'time/month'
:
start_date
=
addToDate
(
next_period_date
,
to_add
=
{
'month'
:
-
1
})
assert
hosting_subscription
.
getNextPeriodicalDate
(
start_date
)
==
next_period_date
else
:
raise
ValueError
(
'Unsupported quantity unit %s'
%
subscription_request
.
getQuantityUnit
())
open_order_edit_kw
=
dict
(
start_date
=
start_date
,
# Ensure stop date value is higher than start date
# it will be updated by OpenSaleOrder_updatePeriod
stop_date
=
start_date
+
1
,
specialise_value
=
subscription_request
.
getSpecialiseValue
(),
source_value
=
subscription_request
.
getDestinationValue
(),
source_section_value
=
subscription_request
.
getDestinationSectionValue
(),
...
...
@@ -57,6 +61,16 @@ open_sale_order = portal.open_sale_order_module.newContent(
activate_kw
=
activate_kw
)
open_sale_order
=
portal
.
open_sale_order_module
.
newContent
(
portal_type
=
"Open Sale Order"
,
# Do not set the stop_date, as we don't know
# when the user will close the subscription
stop_date
=
None
,
**
open_order_edit_kw
)
variation_category_list
=
subscription_request
.
getVariationCategoryList
()
open_order_line
=
open_sale_order
.
newContent
(
portal_type
=
"Open Sale Order Line"
,
...
...
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