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
ce1ca1cb
Commit
ce1ca1cb
authored
Sep 01, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_subscription_request: configure the Subscription Request like a Support Request.
Customer as destination_decision
parent
831d0d96
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
20 deletions
+20
-20
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/Resource_createSubscriptionRequest.py
...ubscription_request/Resource_createSubscriptionRequest.py
+12
-12
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_createOpenSaleOrder.py
...iption_request/SubscriptionRequest_createOpenSaleOrder.py
+8
-8
No files found.
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/Resource_createSubscriptionRequest.py
View file @
ce1ca1cb
...
...
@@ -10,13 +10,13 @@ trade_condition_type = None
item
=
None
if
resource
.
getPortalType
()
==
"Software Product"
:
source
_project_value
=
project_value
destination
_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
source
_project_value
=
project_value
trade_condition_type
=
"compute_node"
elif
resource
.
getRelativeUrl
()
==
"service_module/slapos_virtual_master_subscription"
:
if
project_value
is
None
:
...
...
@@ -30,8 +30,8 @@ else:
######################################################
# Find Sale Trade Condition and price
#
source
_section = subscriber_person_value.getCareerSubordination(subscriber_person_value.getRelativeUrl())
source
_section
=
subscriber_person_value
.
getRelativeUrl
()
#
destination
_section = subscriber_person_value.getCareerSubordination(subscriber_person_value.getRelativeUrl())
destination
_section
=
subscriber_person_value
.
getRelativeUrl
()
# Create a temp Sale Order to calculate the real price and find the trade condition
now
=
DateTime
()
...
...
@@ -44,7 +44,7 @@ tmp_sale_order = module.newContent(
trade_condition_type
=
trade_condition_type
,
start_date
=
now
,
destination_value
=
subscriber_person_value
,
destination_section
=
source
_section
,
destination_section
=
destination
_section
,
#destination_decision_value=source_decision_value,
destination_project_value
=
destination_project_value
,
source_project_value
=
source_project_value
,
...
...
@@ -108,10 +108,10 @@ else:
subscription_request
=
portal
.
subscription_request_module
.
newContent
(
portal_type
=
'Subscription Request'
,
temp_object
=
temp_object
,
source
_value
=
subscriber_person_value
,
source_section_value
=
source
_section
,
source
_decision_value
=
subscriber_person_value
,
source_project_value
=
source
_project_value
,
destination
_value
=
subscriber_person_value
,
destination_section
=
destination
_section
,
destination
_decision_value
=
subscriber_person_value
,
destination_project_value
=
destination
_project_value
,
start_date
=
now
,
effective_date
=
now
,
resource_value
=
resource
,
...
...
@@ -121,9 +121,9 @@ subscription_request = portal.subscription_request_module.newContent(
quantity
=
1
,
ledger
=
"automated"
,
specialise_value
=
tmp_sale_order
.
getSpecialiseValue
(),
destination
=
tmp_sale_order
.
getSource
(),
destination
_section
=
tmp_sale_order
.
getSourceSection
(),
destination_project_value
=
destination
_project_value
,
source
=
tmp_sale_order
.
getSource
(),
source
_section
=
tmp_sale_order
.
getSourceSection
(),
source_project_value
=
source
_project_value
,
price_currency
=
tmp_sale_order
.
getPriceCurrency
(),
price
=
price
,
# XXX activate_kw=activate_kw
...
...
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_createOpenSaleOrder.py
View file @
ce1ca1cb
...
...
@@ -53,14 +53,14 @@ else:
open_order_edit_kw
=
dict
(
start_date
=
start_date
,
specialise_value
=
subscription_request
.
getSpecialiseValue
(),
source_value
=
subscription_request
.
get
Destination
Value
(),
source_section_value
=
subscription_request
.
get
Destination
SectionValue
(),
source_decision_value
=
subscription_request
.
get
Destination
DecisionValue
(),
source_project_value
=
subscription_request
.
get
Destination
ProjectValue
(),
destination_value
=
subscription_request
.
get
Source
Value
(),
destination_section_value
=
subscription_request
.
get
Source
SectionValue
(),
destination_decision_value
=
subscription_request
.
get
Source
DecisionValue
(),
destination_project_value
=
subscription_request
.
get
Source
ProjectValue
(),
source_value
=
subscription_request
.
get
Source
Value
(),
source_section_value
=
subscription_request
.
get
Source
SectionValue
(),
source_decision_value
=
subscription_request
.
get
Source
DecisionValue
(),
source_project_value
=
subscription_request
.
get
Source
ProjectValue
(),
destination_value
=
subscription_request
.
get
Destination
Value
(),
destination_section_value
=
subscription_request
.
get
Destination
SectionValue
(),
destination_decision_value
=
subscription_request
.
get
Destination
DecisionValue
(),
destination_project_value
=
subscription_request
.
get
Destination
ProjectValue
(),
ledger_value
=
portal
.
portal_categories
.
ledger
.
automated
,
causality_value
=
subscription_request
,
price_currency_value
=
subscription_request
.
getPriceCurrencyValue
(),
...
...
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