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
252e07fc
Commit
252e07fc
authored
Jun 04, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_panel: new action to change the ownership of an hosting subscription
parent
c80d86a0
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
466 additions
and
0 deletions
+466
-0
master/bt5/slapos_panel/ActionTemplateItem/portal_types/Person/claim_slapos_item_subscription.xml
...em/portal_types/Person/claim_slapos_item_subscription.xml
+96
-0
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Person_claimSlaposItemSubscription.py
..._skins/slapos_panel/Person_claimSlaposItemSubscription.py
+63
-0
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Person_claimSlaposItemSubscription.xml
...skins/slapos_panel/Person_claimSlaposItemSubscription.xml
+62
-0
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Person_viewClaimSlaposItemSubscriptionDialog.xml
...os_panel/Person_viewClaimSlaposItemSubscriptionDialog.xml
+160
-0
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Person_viewClaimSlaposItemSubscriptionDialog/your_reference.xml
..._viewClaimSlaposItemSubscriptionDialog/your_reference.xml
+84
-0
master/bt5/slapos_panel/bt/template_action_path_list
master/bt5/slapos_panel/bt/template_action_path_list
+1
-0
No files found.
master/bt5/slapos_panel/ActionTemplateItem/portal_types/Person/claim_slapos_item_subscription.xml
0 → 100644
View file @
252e07fc
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ActionInformation"
module=
"Products.CMFCore.ActionInformation"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/object_jio_action
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
category
</string>
</key>
<value>
<string>
object_jio_action
</string>
</value>
</item>
<item>
<key>
<string>
condition
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
claim_slapos_item_subscription
</string>
</value>
</item>
<item>
<key>
<string>
permissions
</string>
</key>
<value>
<tuple>
<string>
View
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
priority
</string>
</key>
<value>
<float>
60.0
</float>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Claim Service Subscription
</string>
</value>
</item>
<item>
<key>
<string>
visible
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
string:${object_url}/Person_viewClaimSlaposItemSubscriptionDialog
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
python: portal.Base_checkPermission(\'subscription_change_request_module\', \'Add portal content\') and (context.getValidationState() == \'validated\')
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Person_claimSlaposItemSubscription.py
0 → 100644
View file @
252e07fc
portal
=
context
.
getPortalObject
()
Base_translateString
=
portal
.
Base_translateString
from
zExceptions
import
Unauthorized
if
REQUEST
is
not
None
:
raise
Unauthorized
batch
=
(
dialog_id
is
None
)
# Search for the matching item
sql_instance_list
=
portal
.
portal_catalog
(
reference
=
reference
,
# Project are not handled yet, as it must also move all compute node subscription at the same time
portal_type
=
[
'Instance Tree'
],
validation_state
=
'validated'
,
limit
=
2
)
if
len
(
sql_instance_list
)
!=
1
:
keep_items
=
{
'your_reference'
:
reference
,
'portal_status_level'
:
'warning'
,
'portal_status_message'
:
Base_translateString
(
'Unknown reference'
)
}
if
batch
:
raise
ValueError
(
keep_items
[
'portal_status_message'
]
+
str
(
len
(
sql_instance_list
)))
return
context
.
Base_renderForm
(
dialog_id
,
keep_items
=
keep_items
)
# Search for the existing Open Sale Order
item
=
sql_instance_list
[
0
].
getObject
()
open_sale_order_cell
=
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
[
'Open Sale Order Line'
,
'Open Sale Order Cell'
],
aggregate__uid
=
item
.
getUid
(),
validation_state
=
'validated'
)
if
open_sale_order_cell
is
None
:
keep_items
=
{
'your_reference'
:
reference
,
'portal_status_level'
:
'warning'
,
'portal_status_message'
:
Base_translateString
(
'No Open Sale Order found'
)
}
if
batch
:
raise
ValueError
(
keep_items
[
'portal_status_message'
])
return
context
.
Base_renderForm
(
dialog_id
,
keep_items
=
keep_items
)
open_sale_order
=
open_sale_order_cell
.
getParentValue
()
while
open_sale_order
.
getPortalType
()
!=
'Open Sale Order'
:
open_sale_order
=
open_sale_order
.
getParentValue
()
# Create the Subscription Change Request
subscription_change_request
=
open_sale_order_cell
.
getResourceValue
().
Resource_createSubscriptionRequest
(
context
,
# [software_type, software_release],
open_sale_order_cell
.
getVariationCategoryList
(),
open_sale_order
.
getSourceProjectValue
(),
currency_value
=
open_sale_order
.
getPriceCurrencyValue
(),
portal_type
=
'Subscription Change Request'
,
item_value
=
item
,
causality_value
=
open_sale_order
)
if
batch
:
return
subscription_change_request
return
subscription_change_request
.
Base_redirect
()
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Person_claimSlaposItemSubscription.xml
0 → 100644
View file @
252e07fc
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
reference, dialog_id, activate_kw=None, REQUEST=None, **kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Person_claimSlaposItemSubscription
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Person_viewClaimSlaposItemSubscriptionDialog.xml
0 → 100644
View file @
252e07fc
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ERP5 Form"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_objects
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
Person_claimSlaposItemSubscription
</string>
</value>
</item>
<item>
<key>
<string>
action_title
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
edit_order
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
encoding
</string>
</key>
<value>
<string>
UTF-8
</string>
</value>
</item>
<item>
<key>
<string>
enctype
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
group_list
</string>
</key>
<value>
<list>
<string>
left
</string>
<string>
right
</string>
<string>
center
</string>
<string>
bottom
</string>
<string>
hidden
</string>
</list>
</value>
</item>
<item>
<key>
<string>
groups
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
bottom
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
center
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
left
</string>
</key>
<value>
<list>
<string>
your_reference
</string>
</list>
</value>
</item>
<item>
<key>
<string>
right
</string>
</key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Person_viewClaimSlaposItemSubscriptionDialog
</string>
</value>
</item>
<item>
<key>
<string>
method
</string>
</key>
<value>
<string>
POST
</string>
</value>
</item>
<item>
<key>
<string>
name
</string>
</key>
<value>
<string>
Person_viewClaimSlaposItemSubscriptionDialog
</string>
</value>
</item>
<item>
<key>
<string>
pt
</string>
</key>
<value>
<string>
form_dialog
</string>
</value>
</item>
<item>
<key>
<string>
row_length
</string>
</key>
<value>
<int>
4
</int>
</value>
</item>
<item>
<key>
<string>
stored_encoding
</string>
</key>
<value>
<string>
UTF-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Claim Subscription
</string>
</value>
</item>
<item>
<key>
<string>
unicode_mode
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
update_action
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
update_action_title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Person_viewClaimSlaposItemSubscriptionDialog/your_reference.xml
0 → 100644
View file @
252e07fc
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
required
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
your_reference
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_dialog_mode_reference
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
required
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_panel/bt/template_action_path_list
View file @
252e07fc
...
...
@@ -34,6 +34,7 @@ Instance Tree | slapos_request_hs_stop
Instance Tree | slapos_view_request_destroy
Instance Tree | update_slapos_parameter
Mail Message | slapos_panel_view
Person | claim_slapos_item_subscription
Person | create_slapos_project
Person | slapos_panel_view
Preference | slapos_panel_view
...
...
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