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
c21cc2ea
Commit
c21cc2ea
authored
Oct 06, 2022
by
Romain Courteaud
🐸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: do not create the open order if the software product can not be found
parent
f913ce84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/InstanceTree_requestUpdateOpenSaleOrder.py
...pos_accounting/InstanceTree_requestUpdateOpenSaleOrder.py
+13
-6
No files found.
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/InstanceTree_requestUpdateOpenSaleOrder.py
View file @
c21cc2ea
...
...
@@ -79,15 +79,12 @@ if instance_tree.getCausalityState() == 'diverged':
hosting_subscription
.
validate
()
start_date
=
hosting_subscription
.
HostingSubscription_calculateSubscriptionStartDate
()
open_sale_order
=
newOpenOrder
(
start_date
)
open_order_explanation
=
""
# Add lines
open_order_line
=
open_sale_order
.
newContent
(
portal_type
=
"Open Sale Order Line"
)
# Search for matching resource
service
=
instance_tree
.
InstanceTree_getSoftwareProduct
()
if
(
service
is
None
)
or
(
service
.
getUse
()
!=
'trade/sale'
):
raise
NotImplementedError
(
'No Software Product defined for %s'
%
instance_tree
.
getRelativeUrl
())
# XXX Add comment on instance tree
return
#raise NotImplementedError('No Software Product defined for %s' % instance_tree.getRelativeUrl())
#assert instance_tree.getPortalType() in service.getRequiredAggregatedPortalTypeList()
software_release
=
portal
.
portal_catalog
.
getResultValue
(
...
...
@@ -101,6 +98,16 @@ if instance_tree.getCausalityState() == 'diverged':
portal_type
=
"Software Product Type Variation"
)
if
software_type
is
None
:
# XXX add comment on instance tree
return
open_sale_order
=
newOpenOrder
(
start_date
)
open_order_explanation
=
""
# Add lines
open_order_line
=
open_sale_order
.
newContent
(
portal_type
=
"Open Sale Order Line"
)
resource_vcl
=
[
'software_release/%s'
%
software_release
.
getRelativeUrl
(),
'software_type/%s'
%
software_type
.
getRelativeUrl
()
...
...
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