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
Labels
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
da464684
Commit
da464684
authored
Aug 23, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_panel: sale agents are not allowed to cancel subscription request
parent
b6aefb84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
25 deletions
+1
-25
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Organisation_claimSlaposSubscriptionRequest.py
...apos_panel/Organisation_claimSlaposSubscriptionRequest.py
+1
-25
No files found.
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Organisation_claimSlaposSubscriptionRequest.py
View file @
da464684
...
...
@@ -27,7 +27,6 @@ if len(sql_subscription_request_list) != 1:
return
context
.
Base_renderForm
(
dialog_id
,
keep_items
=
keep_items
)
subscription_request
=
sql_subscription_request_list
[
0
].
getObject
()
tag
=
"%s-%s"
%
(
script
.
id
,
subscription_request
.
getRelativeUrl
())
if
subscription_request
.
getDestinationSection
()
==
organisation
.
getRelativeUrl
():
keep_items
=
{
...
...
@@ -74,8 +73,6 @@ if (current_trade_condition.getDestination() is None):
trade_condition_type
=
current_trade_condition
.
getTradeConditionType
(),
)
new_sale_trade_condition
.
validate
()
new_sale_trade_condition
.
reindexObject
(
activate_kw
=
{
'tag'
:
tag
})
organisation
.
activate
(
after_tag
=
tag
).
Organisation_claimSlaposSubscriptionRequest
(
reference
,
None
)
keep_items
=
{
'portal_status_message'
:
Base_translateString
(
'Creating a dedicated Trade Condition for the customer'
)
}
...
...
@@ -83,32 +80,11 @@ if (current_trade_condition.getDestination() is None):
return
new_sale_trade_condition
return
new_sale_trade_condition
.
Base_redirect
(
keep_items
=
keep_items
)
elif
((
current_trade_condition
.
getDestination
()
==
subscription_request
.
getDestination
())
and
(
current_trade_condition
.
getDestinationSection
()
==
organisation
.
getRelativeUrl
())):
# We have a matching Trade Condition.
# We can recreate the Subscription Request
subscription_change_request
=
subscription_request
.
getResourceValue
().
Resource_createSubscriptionRequest
(
subscription_request
.
getDestinationValue
(),
# [software_type, software_release],
subscription_request
.
getVariationCategoryList
(),
project
,
currency_value
=
subscription_request
.
getPriceCurrencyValue
(),
item_value
=
item
,
causality_value
=
subscription_request
.
getCausalityValue
()
)
assert
subscription_change_request
.
getDestinationSection
()
==
organisation
.
getRelativeUrl
()
subscription_request
.
cancel
(
comment
=
'Replaced by %s'
%
subscription_change_request
.
getReference
())
if
batch
:
return
subscription_change_request
return
subscription_change_request
.
Base_redirect
()
else
:
keep_items
=
{
'your_reference'
:
reference
,
'portal_status_level'
:
'error'
,
'portal_status_message'
:
Base_translateString
(
'This customer already has a dedicated
incompatible
Trade Condition'
)
'portal_status_message'
:
Base_translateString
(
'This customer already has a dedicated Trade Condition'
)
}
if
batch
:
raise
ValueError
(
keep_items
[
'portal_status_message'
])
...
...
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