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
4224ed22
Commit
4224ed22
authored
Sep 22, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: drop create_new_cloud_contract action
parent
538aa080
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
201 deletions
+0
-201
master/bt5/slapos_accounting/ActionTemplateItem/portal_types/Person/create_new_cloud_contract.xml
...ateItem/portal_types/Person/create_new_cloud_contract.xml
+0
-81
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_contract/Person_generateCloudContract.py
...tal_skins/slapos_contract/Person_generateCloudContract.py
+0
-57
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_contract/Person_generateCloudContract.xml
...al_skins/slapos_contract/Person_generateCloudContract.xml
+0
-62
master/bt5/slapos_accounting/bt/template_action_path_list
master/bt5/slapos_accounting/bt/template_action_path_list
+0
-1
No files found.
master/bt5/slapos_accounting/ActionTemplateItem/portal_types/Person/create_new_cloud_contract.xml
deleted
100644 → 0
View file @
538aa080
<?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>
<string></string>
</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>
create_new_cloud_contract
</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>
50.0
</float>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Create Cloud Contract
</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_generateCloudContract
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_contract/Person_generateCloudContract.py
deleted
100644 → 0
View file @
538aa080
portal
=
context
.
getPortalObject
()
if
context
.
getPortalType
()
!=
"Person"
:
raise
ValueError
(
"This script can only be called under person context"
)
payment_portal_type
=
"Payment Transaction"
contract_portal_type
=
"Cloud Contract"
tag
=
"%s_requestValidationPayment_inProgress"
%
context
.
getUid
()
if
(
portal
.
portal_activities
.
countMessageWithTag
(
tag
)
>
0
):
# The cloud contract is already under creation but can not be fetched from catalog
# As it is not possible to fetch informations, it is better to raise an error
return
None
contract
=
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
contract_portal_type
,
default_destination_section_uid
=
context
.
getUid
(),
validation_state
=
[
'invalidated'
,
'validated'
],
)
msg
=
context
.
Base_translateString
(
"Cloud Contract related to %s"
%
context
.
getTitle
())
if
(
contract
is
None
):
# Prevent concurrent transaction to create 2 contracts for the same person
context
.
serialize
()
# Time to create the contract
contract
=
portal
.
cloud_contract_module
.
newContent
(
portal_type
=
contract_portal_type
,
title
=
'Contract for "%s"'
%
context
.
getTitle
(),
destination_section_value
=
context
)
contract
.
validate
(
comment
=
'New automatic contract for %s'
%
context
.
getTitle
())
contract
.
invalidate
(
comment
=
'New automatic contract for %s'
%
context
.
getTitle
())
contract
.
reindexObject
(
activate_kw
=
{
'tag'
:
tag
})
msg
=
context
.
Base_translateString
(
"Cloud Contract created."
)
if
(
contract
.
getValidationState
()
==
"invalidated"
):
# search if the user already paid anything
payment
=
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
payment_portal_type
,
default_destination_section_uid
=
context
.
getUid
(),
simulation_state
=
[
'stopped'
],
)
if
(
payment
is
not
None
):
# Found one payment, the contract can be validated
comment
=
"Contract validated as paid payment %s found"
%
payment
.
getRelativeUrl
()
contract
.
validate
(
comment
=
comment
)
contract
.
reindexObject
(
activate_kw
=
{
'tag'
:
tag
})
if
batch
:
return
contract
return
contract
.
Base_redirect
(
keep_items
=
{
"portal_status_message"
:
msg
})
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_contract/Person_generateCloudContract.xml
deleted
100644 → 0
View file @
538aa080
<?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>
batch=False
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Person_generateCloudContract
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_accounting/bt/template_action_path_list
View file @
4224ed22
...
...
@@ -8,7 +8,6 @@ Consumption Document Module | view
Hosting Subscription | periodicity
Instance Tree | jump_to_related_open_order_line
Payment Transaction | related_payzen_event
Person | create_new_cloud_contract
Person | jump_to_cloud_contract
Root Applied Rule Causality Causality Movement Group | view
Sale Invoice Transaction | create_slapos_reversal
...
...
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