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
cd0cf8e4
Commit
cd0cf8e4
authored
Sep 06, 2022
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: use Software Product instead of the service slapos_instance_subscription
parent
f30637ca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/InstanceTree_requestUpdateOpenSaleOrder.py
...pos_accounting/InstanceTree_requestUpdateOpenSaleOrder.py
+7
-9
No files found.
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/InstanceTree_requestUpdateOpenSaleOrder.py
View file @
cd0cf8e4
...
@@ -80,14 +80,12 @@ if instance_tree.getCausalityState() == 'diverged':
...
@@ -80,14 +80,12 @@ if instance_tree.getCausalityState() == 'diverged':
start_date
=
hosting_subscription
.
HostingSubscription_calculateSubscriptionStartDate
()
start_date
=
hosting_subscription
.
HostingSubscription_calculateSubscriptionStartDate
()
# Search for matching resource
# Search for matching resource
service_list
=
portal
.
portal_catalog
(
service
=
instance_tree
.
InstanceTree_getSoftwareProduct
()
# XXX Hardcoded as temporary
if
(
service
is
None
)
or
(
service
.
getUse
()
!=
'trade/sale'
):
id
=
'slapos_instance_subscription'
,
raise
NotImplementedError
(
'No Software Product defined for %s'
%
instance_tree
.
getRelativeUrl
())
portal_type
=
'Service'
,
validation_state
=
'validated'
,
#assert instance_tree.getPortalType() in service.getRequiredAggregatedPortalTypeList()
use__relative_url
=
'use/trade/sale'
)
service
=
[
x
for
x
in
service_list
if
instance_tree
.
getPortalType
()
in
x
.
getRequiredAggregatedPortalTypeList
()][
0
].
getObject
()
edit_kw
=
{
edit_kw
=
{
'quantity'
:
1
,
'quantity'
:
1
,
'resource_value'
:
service
,
'resource_value'
:
service
,
...
@@ -152,7 +150,7 @@ if instance_tree.getCausalityState() == 'diverged':
...
@@ -152,7 +150,7 @@ if instance_tree.getCausalityState() == 'diverged':
if
open_order_line
is
not
None
:
if
open_order_line
is
not
None
:
open_order
=
open_order_line
.
getParentValue
()
open_order
=
open_order_line
.
getParentValue
()
assert
open_order_line
.
getResource
()
==
'service_module/slapos_instance_subscription'
assert
open_order_line
.
getResource
()
.
startswith
(
'software_product'
)
assert
open_order_line
.
getQuantityUnit
()
==
'unit/piece'
assert
open_order_line
.
getQuantityUnit
()
==
'unit/piece'
assert
open_order_line
.
getBaseContribution
()
==
'base_amount/invoicing/discounted'
assert
open_order_line
.
getBaseContribution
()
==
'base_amount/invoicing/discounted'
assert
open_order_line
.
getBaseContributionList
()[
1
]
==
'base_amount/invoicing/taxable'
assert
open_order_line
.
getBaseContributionList
()[
1
]
==
'base_amount/invoicing/taxable'
...
...
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