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
10901d12
Commit
10901d12
authored
Nov 28, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_upgrader: allow to run the migration multiple time
parent
5b6886a6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
41 deletions
+47
-41
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/Base_triggerFullSiteMigrationToVirtualMaster.py
..._upgrader/Base_triggerFullSiteMigrationToVirtualMaster.py
+38
-33
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/ProjectModule_triggerObjectMigrationToVirtualMaster.py
...er/ProjectModule_triggerObjectMigrationToVirtualMaster.py
+9
-8
No files found.
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/Base_triggerFullSiteMigrationToVirtualMaster.py
View file @
10901d12
...
@@ -4,17 +4,22 @@ tag = script.id
...
@@ -4,17 +4,22 @@ tag = script.id
### Create the bootstrap Trade Condition
### Create the bootstrap Trade Condition
currency
=
portal
.
restrictedTraverse
(
'currency_module/EUR'
)
currency
=
portal
.
restrictedTraverse
(
'currency_module/EUR'
)
seller_organisation
=
portal
.
restrictedTraverse
(
'organisation_module/rapidspace'
)
seller_organisation
=
portal
.
restrictedTraverse
(
'organisation_module/rapidspace'
)
business_process
=
portal
.
restrictedTraverse
(
'business_process_module/slapos_ultimate_business_process'
)
# Sale Trade Condition for Tax
if
portal
.
portal_catalog
.
getResultValue
(
sale_trade_condition
=
portal
.
sale_trade_condition_module
.
newContent
(
portal_type
=
'Sale Trade Condition'
,
specialise__uid
=
business_process
.
getUid
()
)
is
None
:
# Sale Trade Condition for Tax
sale_trade_condition
=
portal
.
sale_trade_condition_module
.
newContent
(
portal_type
=
"Sale Trade Condition"
,
portal_type
=
"Sale Trade Condition"
,
reference
=
"Tax/payment for: %s"
%
currency
.
getRelativeUrl
(),
reference
=
"Tax/payment for: %s"
%
currency
.
getRelativeUrl
(),
trade_condition_type
=
"default"
,
trade_condition_type
=
"default"
,
# XXX hardcoded
# XXX hardcoded
specialise
=
"business_process_module/slapos_ultimate_business_process"
,
specialise_value
=
business_process
,
price_currency_value
=
currency
price_currency_value
=
currency
)
)
sale_trade_condition
.
newContent
(
sale_trade_condition
.
newContent
(
portal_type
=
"Trade Model Line"
,
portal_type
=
"Trade Model Line"
,
reference
=
"VAT"
,
reference
=
"VAT"
,
resource
=
"service_module/slapos_tax"
,
resource
=
"service_module/slapos_tax"
,
...
@@ -24,20 +29,20 @@ sale_trade_condition.newContent(
...
@@ -24,20 +29,20 @@ sale_trade_condition.newContent(
quantity
=
1.0
,
quantity
=
1.0
,
membership_criterion_base_category
=
(
'price_currency'
,
'base_contribution'
),
membership_criterion_base_category
=
(
'price_currency'
,
'base_contribution'
),
membership_criterion_category
=
(
'price_currency/%s'
%
currency
.
getRelativeUrl
(),
'base_contribution/base_amount/invoicing/taxable'
)
membership_criterion_category
=
(
'price_currency/%s'
%
currency
.
getRelativeUrl
(),
'base_contribution/base_amount/invoicing/taxable'
)
)
)
sale_trade_condition
.
validate
()
sale_trade_condition
.
validate
()
sale_trade_condition
.
reindexObject
(
activate_kw
=
{
'tag'
:
tag
})
sale_trade_condition
.
reindexObject
(
activate_kw
=
{
'tag'
:
tag
})
# Create Trade Condition to create Project
# Create Trade Condition to create Project
sale_trade_condition
=
portal
.
sale_trade_condition_module
.
newContent
(
sale_trade_condition
=
portal
.
sale_trade_condition_module
.
newContent
(
portal_type
=
"Sale Trade Condition"
,
portal_type
=
"Sale Trade Condition"
,
reference
=
"Free Virtual Master (%s)"
%
seller_organisation
.
getTitle
(),
reference
=
"Free Virtual Master (%s)"
%
seller_organisation
.
getTitle
(),
trade_condition_type
=
"virtual_master"
,
trade_condition_type
=
"virtual_master"
,
specialise_value
=
sale_trade_condition
,
specialise_value
=
sale_trade_condition
,
source_value
=
seller_organisation
,
source_value
=
seller_organisation
,
price_currency_value
=
currency
,
price_currency_value
=
currency
,
)
)
sale_trade_condition
.
validate
()
sale_trade_condition
.
validate
()
sale_trade_condition
.
reindexObject
(
activate_kw
=
{
'tag'
:
tag
})
sale_trade_condition
.
reindexObject
(
activate_kw
=
{
'tag'
:
tag
})
return
context
.
activate
(
after_tag
=
tag
).
Base_triggerFullSiteMigrationToVirtualMasterStep2
()
return
context
.
activate
(
after_tag
=
tag
).
Base_triggerFullSiteMigrationToVirtualMasterStep2
()
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/ProjectModule_triggerObjectMigrationToVirtualMaster.py
View file @
10901d12
...
@@ -17,8 +17,9 @@ for sql_result in portal.portal_catalog(
...
@@ -17,8 +17,9 @@ for sql_result in portal.portal_catalog(
portal_type
=
"Subscription Request"
,
portal_type
=
"Subscription Request"
,
):
):
subscription_request
=
sql_result
.
getObject
()
subscription_request
=
sql_result
.
getObject
()
instance_tree
=
subscription_request
.
getAggregateValue
(
portal_type
=
"Instance Tree"
)
if
subscription_request
.
getSpecialise
(
''
).
startswith
(
'subscription_condition'
):
instance_tree
=
subscription_request
.
getAggregateValue
(
portal_type
=
"Instance Tree"
)
if
(
instance_tree
is
not
None
):
if
(
instance_tree
is
not
None
):
context
.
log
(
'COUSCOUS %s'
%
subscription_request
.
getRelativeUrl
())
context
.
log
(
'COUSCOUS %s'
%
subscription_request
.
getRelativeUrl
())
# Build the list of prices per project/software release
# Build the list of prices per project/software release
...
...
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