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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
124fc001
Commit
124fc001
authored
Jan 20, 2022
by
Romain Courteaud
🐸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: how to find the service to use
parent
9f2e9559
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/InstanceTree_requestUpdateOpenSaleOrder.py
...pos_accounting/InstanceTree_requestUpdateOpenSaleOrder.py
+18
-1
No files found.
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/InstanceTree_requestUpdateOpenSaleOrder.py
View file @
124fc001
...
...
@@ -79,7 +79,24 @@ if instance_tree.getCausalityState() == 'diverged':
hosting_subscription
.
validate
()
start_date
=
hosting_subscription
.
HostingSubscription_calculateSubscriptionStartDate
()
edit_kw
=
{}
# Search for matching resource
service_list
=
portal
.
portal_catalog
(
# XXX Hardcoded as temporary
id
=
'slapos_instance_subscription'
,
portal_type
=
'Service'
,
validation_state
=
'validated'
,
use__relative_url
=
'use/trade/sale'
)
service
=
[
x
for
x
in
service_list
if
instance_tree
.
getPortalType
()
in
x
.
getRequiredAggregatedPortalTypeList
()][
0
].
getObject
()
edit_kw
=
{
'quantity'
:
1
,
'resource_value'
:
service
,
'quantity_unit'
:
service
.
getQuantityUnit
(),
'base_contribution_list'
:
service
.
getBaseContributionList
(),
'use'
:
service
.
getUse
(),
# XXX Hardcoded
'price'
:
1
}
subscription_request
=
instance_tree
.
getAggregateRelatedValue
(
portal_type
=
"Subscription Request"
)
# Define the start date of the period, this can variates with the time.
# start_date_delta = 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