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
6860d171
Commit
6860d171
authored
Aug 14, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_subscription_request: set trade_condition_type on temporary Sale Order
parent
a5e2ebad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/Resource_createSubscriptionRequest.py
...ubscription_request/Resource_createSubscriptionRequest.py
+5
-0
No files found.
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/Resource_createSubscriptionRequest.py
View file @
6860d171
...
...
@@ -6,19 +6,23 @@ if subscriber_person_value is None:
source_project_value
=
None
destination_project_value
=
None
trade_condition_type
=
None
item
=
None
if
resource
.
getPortalType
()
==
"Software Product"
:
source_project_value
=
project_value
trade_condition_type
=
"instance_tree"
elif
resource
.
getPortalType
()
==
"Service"
:
if
resource
.
getRelativeUrl
()
==
"service_module/slapos_compute_node_subscription"
:
if
project_value
is
None
:
raise
AssertionError
(
'A project is required for %s %s'
%
(
resource
.
getRelativeUrl
(),
project_value
))
destination_project_value
=
project_value
trade_condition_type
=
"compute_node"
elif
resource
.
getRelativeUrl
()
==
"service_module/slapos_virtual_master_subscription"
:
if
project_value
is
None
:
raise
AssertionError
(
'Project is required for %s %s'
%
(
resource
.
getRelativeUrl
(),
project_value
))
item
=
project_value
trade_condition_type
=
"virtual_master"
else
:
raise
NotImplementedError
(
'Unsupported resource: %s'
%
resource
.
getRelativeUrl
())
else
:
...
...
@@ -37,6 +41,7 @@ module = portal.portal_trash
tmp_sale_order
=
module
.
newContent
(
portal_type
=
'Sale Order'
,
temp_object
=
True
,
trade_condition_type
=
trade_condition_type
,
start_date
=
now
,
destination_value
=
subscriber_person_value
,
destination_section
=
source_section
,
...
...
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