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
6995e47e
Commit
6995e47e
authored
Jan 20, 2021
by
Cédric Le Ninivin
Committed by
Rafael Monnerat
Jan 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_subscription_request: add audit constraint to Subscription Request
parent
8f4e02e7
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
582 additions
and
3 deletions
+582
-3
master/bt5/slapos_subscription_request/PathTemplateItem/portal_alarms/slapos_update_subscription_request_consistency_state.xml
.../slapos_update_subscription_request_consistency_state.xml
+204
-0
master/bt5/slapos_subscription_request/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
...rtalTypePropertySheetTemplateItem/property_sheet_list.xml
+1
-0
master/bt5/slapos_subscription_request/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
...rtalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
+1
-1
master/bt5/slapos_subscription_request/PropertySheetTemplateItem/portal_property_sheets/SlaposSubscriptionRequestAuditConstraint.xml
...perty_sheets/SlaposSubscriptionRequestAuditConstraint.xml
+66
-0
master/bt5/slapos_subscription_request/PropertySheetTemplateItem/portal_property_sheets/SlaposSubscriptionRequestAuditConstraint/SubscriptionRequestCheckRelatedAccounting_constraint.xml
.../SubscriptionRequestCheckRelatedAccounting_constraint.xml
+80
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_viewSubscriptionRequestList/listbox.xml
...tionRequestModule_viewSubscriptionRequestList/listbox.xml
+24
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_checkRelatedAccounting.py
...ion_request/SubscriptionRequest_checkRelatedAccounting.py
+53
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_checkRelatedAccounting.xml
...on_request/SubscriptionRequest_checkRelatedAccounting.xml
+62
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_view.xml
.../slapos_subscription_request/SubscriptionRequest_view.xml
+1
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_view/my_translated_validation_state_title.xml
...tionRequest_view/my_translated_validation_state_title.xml
+84
-0
master/bt5/slapos_subscription_request/bt/template_path_list
master/bt5/slapos_subscription_request/bt/template_path_list
+2
-1
master/bt5/slapos_subscription_request/bt/template_portal_type_property_sheet_list
...ption_request/bt/template_portal_type_property_sheet_list
+1
-0
master/bt5/slapos_subscription_request/bt/template_portal_type_workflow_chain_list
...ption_request/bt/template_portal_type_workflow_chain_list
+1
-0
master/bt5/slapos_subscription_request/bt/template_property_sheet_id_list
...s_subscription_request/bt/template_property_sheet_id_list
+2
-1
No files found.
master/bt5/slapos_subscription_request/PathTemplateItem/portal_alarms/slapos_update_subscription_request_consistency_state.xml
0 → 100644
View file @
6995e47e
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Alarm"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_local_properties
</string>
</key>
<value>
<tuple>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
configuration_form_id
</string>
</value>
</item>
<item>
<key>
<string>
type
</string>
</key>
<value>
<string>
string
</string>
</value>
</item>
</dictionary>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
catalog_query_string
</string>
</value>
</item>
<item>
<key>
<string>
type
</string>
</key>
<value>
<string>
string
</string>
</value>
</item>
</dictionary>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
module_list
</string>
</value>
</item>
<item>
<key>
<string>
type
</string>
</key>
<value>
<string>
lines
</string>
</value>
</item>
</dictionary>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
incremental_check
</string>
</value>
</item>
<item>
<key>
<string>
type
</string>
</key>
<value>
<string>
int
</string>
</value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key>
<string>
active_sense_method_id
</string>
</key>
<value>
<string>
Alarm_activateUpdateValidationStateFromConsistencyResult
</string>
</value>
</item>
<item>
<key>
<string>
automatic_solve
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
catalog_query_string
</string>
</key>
<value>
<string>
validation_state:!=deleted
</string>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
configuration_form_id
</string>
</key>
<value>
<string>
Alarm_viewConsistencyCheckConfiguration
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
slapos_update_subscription_request_consistency_state
</string>
</value>
</item>
<item>
<key>
<string>
incremental_check
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
module_list
</string>
</key>
<value>
<tuple>
<string>
subscription_request_module
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
periodicity_day_frequency
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
periodicity_hour
</string>
</key>
<value>
<tuple>
<int>
3
</int>
</tuple>
</value>
</item>
<item>
<key>
<string>
periodicity_hour_frequency
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
periodicity_minute
</string>
</key>
<value>
<tuple>
<int>
25
</int>
</tuple>
</value>
</item>
<item>
<key>
<string>
periodicity_minute_frequency
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
periodicity_month
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_month_day
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_start_date
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1230768000.0
</float>
<string>
GMT
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
periodicity_week
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_week_day
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_week_frequency
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Alarm
</string>
</value>
</item>
<item>
<key>
<string>
report_method_id
</string>
</key>
<value>
<string>
Alarm_viewConsistencyCheckReport
</string>
</value>
</item>
<item>
<key>
<string>
solve_method_id
</string>
</key>
<value>
<string>
Alarm_activateFixConsistency
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Subscription Request Update Validation State From Consistency
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_subscription_request/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
View file @
6995e47e
...
...
@@ -15,6 +15,7 @@
<item>
Person
</item>
<item>
Price
</item>
<item>
Reference
</item>
<item>
SlaposSubscriptionRequestAuditConstraint
</item>
<item>
SoftwareInstance
</item>
<item>
Task
</item>
<item>
TextDocument
</item>
...
...
master/bt5/slapos_subscription_request/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
View file @
6995e47e
...
...
@@ -9,7 +9,7 @@
</chain>
<chain>
<type>
Subscription Request
</type>
<workflow>
edit_workflow, subscription_request_workflow
</workflow>
<workflow>
edit_workflow, subscription_request_workflow
, validation_workflow
</workflow>
</chain>
<chain>
<type>
Trial Condition
</type>
...
...
master/bt5/slapos_subscription_request/PropertySheetTemplateItem/portal_property_sheets/SlaposSubscriptionRequestAuditConstraint.xml
0 → 100644
View file @
6995e47e
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Property Sheet"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_count
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_mt_index
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_tree
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SlaposSubscriptionRequestAuditConstraint
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Property Sheet
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Length"
module=
"BTrees.Length"
/>
</pickle>
<pickle>
<int>
0
</int>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_subscription_request/PropertySheetTemplateItem/portal_property_sheets/SlaposSubscriptionRequestAuditConstraint/SubscriptionRequestCheckRelatedAccounting_constraint.xml
0 → 100644
View file @
6995e47e
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Script Constraint"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_identity_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_range_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
constraint_type/audit
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SubscriptionRequestCheckRelatedAccounting_constraint
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Script Constraint
</string>
</value>
</item>
<item>
<key>
<string>
script_id
</string>
</key>
<value>
<string>
SubscriptionRequest_checkRelatedAccounting
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_viewSubscriptionRequestList/listbox.xml
View file @
6995e47e
...
...
@@ -10,6 +10,7 @@
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
all_columns
</string>
<string>
columns
</string>
<string>
selection_name
</string>
<string>
title
</string>
...
...
@@ -73,6 +74,29 @@
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
all_columns
</string>
</key>
<value>
<list>
<tuple>
<string>
creation_date
</string>
<string>
Creation Date
</string>
</tuple>
<tuple>
<string>
modification_date
</string>
<string>
Modification Date
</string>
</tuple>
<tuple>
<string>
owner_title
</string>
<string>
Owner
</string>
</tuple>
<tuple>
<string>
translated_validation_state_title
</string>
<string>
Consistency State
</string>
</tuple>
</list>
</value>
</item>
<item>
<key>
<string>
columns
</string>
</key>
<value>
...
...
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_checkRelatedAccounting.py
0 → 100644
View file @
6995e47e
subscription_request
=
context
portal
=
context
.
getPortalObject
()
translate
=
portal
.
Base_translateString
status_list
=
[]
def
addToStatusList
(
status_text
,
mapping
=
{}):
status_list
.
append
(
translate
(
status_text
,
mapping
=
mapping
))
if
not
context
.
getSimulationState
()
in
(
"ordered"
,
"confirmed"
,
"started"
,
"stopped"
,
"delivered"
):
return
[]
subscription_trade_condition
=
portal
.
sale_trade_condition_module
.
slapos_aggregated_subscription_trade_condition
refund_service
=
portal
.
service_module
.
slapos_reservation_refund
sale_packing_list_list
=
portal
.
portal_catalog
(
portal_type
=
"Sale Packing List"
,
strict_causality_uid
=
subscription_request
.
getUid
(),
strict_destination_uid
=
subscription_request
.
getDestinationSectionUid
(),
strict_destination_section_uid
=
subscription_request
.
getDestinationSectionUid
(),
strict_specialise_uid
=
subscription_trade_condition
.
getUid
(),
simulation_state
=
"delivered"
,
)
if
sale_packing_list_list
:
sale_invoice_list
=
portal
.
portal_catalog
(
portal_type
=
"Sale Invoice Transaction"
,
strict_causality_uid
=
[
x
.
getUid
()
for
x
in
sale_packing_list_list
],
)
subscription_currency
=
subscription_request
.
getPriceCurrency
()
for
sale_invoice
in
sale_invoice_list
:
sale_invoice
=
sale_invoice
.
getObject
()
if
sale_invoice
.
getPriceCurrency
()
!=
subscription_currency
:
addToStatusList
(
"${invoice_relative_url} Sale Invoice currency ${invoice_currency} do not match subscription currency ${subscription_currency}"
,
{
"invoice_relative_url"
:
sale_invoice
.
getRelativeUrl
(),
"invoice_currency"
:
sale_invoice
.
getPriceCurrency
(),
"subscription_currency"
:
subscription_currency
,
}
)
if
sale_invoice
.
getSimulationState
()
not
in
(
"stopped"
,
"delivered"
,
"cancelled"
):
addToStatusList
(
"${invoice_relative_url} Sale Invoice in unexpected simulation state: ${invoice_simulation_state}"
,
{
"invoice_relative_url"
:
sale_invoice
.
getRelativeUrl
(),
"invoice_simulation_state"
:
sale_invoice
.
getSimulationState
(),
}
)
return
status_list
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_checkRelatedAccounting.xml
0 → 100644
View file @
6995e47e
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<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>
fixit=0
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SubscriptionRequest_checkRelatedAccounting
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_view.xml
View file @
6995e47e
...
...
@@ -104,6 +104,7 @@
<string>
my_start_date
</string>
<string>
my_stop_date
</string>
<string>
my_translated_simulation_state_title
</string>
<string>
my_translated_validation_state_title
</string>
<string>
my_subject_list
</string>
</list>
</value>
...
...
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_view/my_translated_validation_state_title.xml
0 → 100644
View file @
6995e47e
<?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>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_translated_validation_state_title
</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_view_mode_translated_workflow_state_title
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Consistency State
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_subscription_request/bt/template_path_list
View file @
6995e47e
...
...
@@ -9,3 +9,4 @@ accounting_module/template_wechat_pre_payment_subscription_sale_invoice_transact
notification_message_module/slapos-free-trial-token
portal_alarms/slapos_subscription_request_process_**
portal_alarms/slapos_trial_process_**
portal_alarms/slapos_update_subscription_request_consistency_state
\ No newline at end of file
master/bt5/slapos_subscription_request/bt/template_portal_type_property_sheet_list
View file @
6995e47e
...
...
@@ -11,6 +11,7 @@ Subscription Request | HostingSubscription
Subscription Request | Person
Subscription Request | Price
Subscription Request | Reference
Subscription Request | SlaposSubscriptionRequestAuditConstraint
Subscription Request | SoftwareInstance
Subscription Request | Task
Subscription Request | TextDocument
...
...
master/bt5/slapos_subscription_request/bt/template_portal_type_workflow_chain_list
View file @
6995e47e
...
...
@@ -3,6 +3,7 @@ Subscription Condition | commerce_validation_workflow
Subscription Condition | edit_workflow
Subscription Request | edit_workflow
Subscription Request | subscription_request_workflow
Subscription Request | validation_workflow
Trial Condition | commerce_validation_workflow
Trial Condition | edit_workflow
Trial Request | edit_workflow
...
...
master/bt5/slapos_subscription_request/bt/template_property_sheet_id_list
View file @
6995e47e
TrialCondition
SlapOSSubscriptionCondition
SlaposSubscriptionRequestAuditConstraint
\ No newline at end of file
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