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
0
Merge Requests
0
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
Lu Xu
slapos.core
Commits
4fe16eae
Commit
4fe16eae
authored
Oct 12, 2018
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_subscription_request: Add pricing for Subscription Condition/Request
parent
98581a6e
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
528 additions
and
15 deletions
+528
-15
master/bt5/slapos_subscription_request/PortalTypeBaseCategoryTemplateItem/base_category_list.xml
...PortalTypeBaseCategoryTemplateItem/base_category_list.xml
+2
-0
master/bt5/slapos_subscription_request/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
...rtalTypePropertySheetTemplateItem/property_sheet_list.xml
+3
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionCondition_view.xml
...lapos_subscription_request/SubscriptionCondition_view.xml
+2
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionCondition_view/my_price.xml
...scription_request/SubscriptionCondition_view/my_price.xml
+100
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionCondition_view/my_price_currency.xml
..._request/SubscriptionCondition_view/my_price_currency.xml
+90
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_applyCondition.py
...ubscription_request/SubscriptionRequest_applyCondition.py
+12
-15
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_view.xml
.../slapos_subscription_request/SubscriptionRequest_view.xml
+3
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_view/my_price.xml
...ubscription_request/SubscriptionRequest_view/my_price.xml
+105
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_view/my_price_currency.xml
...on_request/SubscriptionRequest_view/my_price_currency.xml
+96
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_view/my_quantity.xml
...cription_request/SubscriptionRequest_view/my_quantity.xml
+110
-0
master/bt5/slapos_subscription_request/bt/template_portal_type_base_category_list
...iption_request/bt/template_portal_type_base_category_list
+2
-0
master/bt5/slapos_subscription_request/bt/template_portal_type_property_sheet_list
...ption_request/bt/template_portal_type_property_sheet_list
+3
-0
No files found.
master/bt5/slapos_subscription_request/PortalTypeBaseCategoryTemplateItem/base_category_list.xml
View file @
4fe16eae
...
...
@@ -2,6 +2,7 @@
<portal_type
id=
"Subscription Condition"
>
<item>
aggregate
</item>
<item>
follow_up
</item>
<item>
source_section
</item>
</portal_type>
<portal_type
id=
"Subscription Condition Module"
>
<item>
business_application
</item>
...
...
@@ -10,6 +11,7 @@
<item>
aggregate
</item>
<item>
causality
</item>
<item>
destination_section
</item>
<item>
source_section
</item>
<item>
specialise
</item>
</portal_type>
<portal_type
id=
"Subscription Request Module"
>
...
...
master/bt5/slapos_subscription_request/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
View file @
4fe16eae
<property_sheet_list>
<portal_type
id=
"Subscription Condition"
>
<item>
HostingSubscription
</item>
<item>
Price
</item>
<item>
SlapOSSubscriptionCondition
</item>
<item>
SoftwareInstance
</item>
<item>
TextDocument
</item>
<item>
Url
</item>
...
...
@@ -10,6 +12,7 @@
<item>
CredentialRequest
</item>
<item>
HostingSubscription
</item>
<item>
Person
</item>
<item>
Reference
</item>
<item>
SlapOSAccountingHostingSubscriptionConstraint
</item>
<item>
SlaposHostingSubscriptionConstraint
</item>
<item>
SoftwareInstance
</item>
...
...
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionCondition_view.xml
View file @
4fe16eae
...
...
@@ -91,6 +91,8 @@
<key>
<string>
right
</string>
</key>
<value>
<list>
<string>
my_price
</string>
<string>
my_price_currency
</string>
<string>
my_aggregate_title
</string>
<string>
my_follow_up_title
</string>
<string>
my_translated_validation_state_title
</string>
...
...
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionCondition_view/my_price.xml
0 → 100644
View file @
4fe16eae
<?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>
enabled
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_price
</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>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_view_mode_price
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewTradeFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionCondition_view/my_price_currency.xml
0 → 100644
View file @
4fe16eae
<?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/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_price_currency
</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>
<item>
<key>
<string>
target
</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>
<item>
<key>
<string>
target
</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_view_mode_price_currency
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewTradeFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_applyCondition.py
View file @
4fe16eae
...
...
@@ -2,9 +2,9 @@ from zExceptions import Unauthorized
if
REQUEST
is
not
None
:
raise
Unauthorized
if
context
.
getSimulationState
()
not
in
[
"draft"
,
"planned"
]:
#
if context.getSimulationState() not in ["draft", "planned"]:
# Don't modify it anymore
return
#
return
if
subscription_condition_reference
is
not
None
:
# It would be better use some clever API here.
...
...
@@ -23,23 +23,20 @@ if subscription_condition is None:
instance_xml
=
subscription_condition
.
SubscriptionCondition_renderParameter
(
amount
=
int
(
context
.
getQuantity
()))
# Get Subscription condition for this Subscription Request
subscription_configuration
=
{
"instance_xml"
:
instance_xml
,
"software_type"
:
subscription_condition
.
getSourceReference
(),
"url"
:
subscription_condition
.
getUrlString
(),
"shared"
:
subscription_condition
.
getRootSlave
(),
"sla_xml"
:
subscription_condition
.
getSlaXml
(),
"specialise"
:
subscription_condition
.
getRelativeUrl
()
}
email
=
context
.
getDestinationSectionValue
().
getDefaultEmailText
()
now
=
DateTime
()
context
.
edit
(
source_reference
=
subscription_configuration
[
"software_type"
],
title
=
"Subscription %s for %s"
%
(
subscription_condition
.
getTitle
(),
email
),
url_string
=
subscription_configuration
[
"url"
],
text_content
=
subscription_configuration
[
"instance_xml"
],
url_string
=
subscription_condition
.
getUrlString
(),
text_content
=
instance_xml
,
sla_xml
=
subscription_condition
.
getSlaXml
(),
start_date
=
now
,
root_slave
=
subscription_configuration
[
"shared"
],
specialise_value
=
subscription_condition
root_slave
=
subscription_condition
.
getRootSlave
(),
specialise_value
=
subscription_condition
,
price
=
subscription_condition
.
getPrice
(),
price_currency
=
subscription_condition
.
getPriceCurrency
()
)
context
.
setSourceReference
(
subscription_condition
.
getSourceReference
())
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_view.xml
View file @
4fe16eae
...
...
@@ -98,6 +98,9 @@
<key>
<string>
right
</string>
</key>
<value>
<list>
<string>
my_quantity
</string>
<string>
my_price
</string>
<string>
my_price_currency
</string>
<string>
my_start_date
</string>
<string>
my_stop_date
</string>
<string>
my_translated_simulation_state_title
</string>
...
...
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_view/my_price.xml
0 → 100644
View file @
4fe16eae
<?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>
editable
</string>
<string>
enabled
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_price
</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>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_view_mode_price
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewTradeFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_view/my_price_currency.xml
0 → 100644
View file @
4fe16eae
<?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>
editable
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_price_currency
</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>
<item>
<key>
<string>
target
</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>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_view_mode_price_currency
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewTradeFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_view/my_quantity.xml
0 → 100644
View file @
4fe16eae
<?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>
editable
</string>
<string>
enabled
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_quantity
</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>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_view_mode_quantity
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewTradeFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Quantity
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_subscription_request/bt/template_portal_type_base_category_list
View file @
4fe16eae
Subscription Condition Module | business_application
Subscription Condition | aggregate
Subscription Condition | follow_up
Subscription Condition | source_section
Subscription Request Module | business_application
Subscription Request | aggregate
Subscription Request | causality
Subscription Request | destination_section
Subscription Request | source_section
Subscription Request | specialise
Trial Condition Module | business_application
Trial Condition | aggregate
...
...
master/bt5/slapos_subscription_request/bt/template_portal_type_property_sheet_list
View file @
4fe16eae
Subscription Condition | HostingSubscription
Subscription Condition | Price
Subscription Condition | SlapOSSubscriptionCondition
Subscription Condition | SoftwareInstance
Subscription Condition | TextDocument
Subscription Condition | Url
...
...
@@ -6,6 +8,7 @@ Subscription Request | Amount
Subscription Request | CredentialRequest
Subscription Request | HostingSubscription
Subscription Request | Person
Subscription Request | Reference
Subscription Request | SlapOSAccountingHostingSubscriptionConstraint
Subscription Request | SlaposHostingSubscriptionConstraint
Subscription Request | SoftwareInstance
...
...
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