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
668187df
Commit
668187df
authored
Nov 28, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_panel: virtual master can be free, and instance payble
parent
50073928
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Person_addVirtualMaster.py
...Item/portal_skins/slapos_panel/Person_addVirtualMaster.py
+10
-4
No files found.
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Person_addVirtualMaster.py
View file @
668187df
...
...
@@ -32,11 +32,11 @@ subscription_request.reindexObject(activate_kw=activate_kw)
# XXX How to specify the trade condition containing the currency and trade model lines?
specialise_value
=
subscription_request
.
getSpecialiseValue
(
portal_type
=
"Sale Trade Condition"
)
if
((
specialise_value
is
not
None
)
and
(
specialise_value
.
getPriceCurrency
(
''
)
==
''
)
and
(
len
(
specialise_value
.
contentValues
(
portal_type
=
"Trade Model Line"
))
==
0
)):
specialise_value
=
specialise_value
.
getSpecialiseValue
(
portal_type
=
"Sale Trade Condition"
)
if
specialise_value
is
None
:
if
((
specialise_value
is
None
)
or
(
len
(
specialise_value
.
contentValues
(
portal_type
=
"Trade Model Line"
))
==
0
)):
raise
ValueError
(
'Could not find a Trade Condition with Trade Model Line'
)
# and create default assignments for the user
...
...
@@ -56,7 +56,10 @@ customer.newContent(
# Compute Node trade condition
if
is_compute_node_payable
:
source_section_value
=
subscription_request
.
getSourceSectionValue
(
None
)
source_section_value
=
subscription_request
.
getSourceSectionValue
(
default
=
subscription_request
.
getSourceValue
(
default
=
None
,
portal_type
=
'Organisation'
),
portal_type
=
'Organisation'
)
if
source_section_value
is
None
:
raise
AssertionError
(
'No source section found to generate the invoices'
)
title
=
'Payable Compute Node for: %s'
%
project
.
getTitle
()
...
...
@@ -79,7 +82,10 @@ sale_trade_condition.validate()
# Instance Tree trade condition
if
is_instance_tree_payable
:
source_section_value
=
subscription_request
.
getSourceSectionValue
(
None
)
source_section_value
=
subscription_request
.
getSourceSectionValue
(
default
=
subscription_request
.
getSourceValue
(
default
=
None
,
portal_type
=
'Organisation'
),
portal_type
=
'Organisation'
)
if
source_section_value
is
None
:
raise
AssertionError
(
'No source section found to generate the invoices'
)
title
=
'Payable Instance Tree for: %s'
%
project
.
getTitle
()
...
...
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