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
Guillaume Hervier
slapos.core
Commits
71b79d5e
Commit
71b79d5e
authored
Oct 25, 2012
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fetch hosting subscription directly from instance
parent
848fc3e7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
21 deletions
+9
-21
master/bt5/vifib_erp5/ExtensionTemplateItem/VifibSecurity.py
master/bt5/vifib_erp5/ExtensionTemplateItem/VifibSecurity.py
+3
-13
master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/ERP5Type_getSecurityCategoryFromRelatedOpenOrder.xml
...core/ERP5Type_getSecurityCategoryFromRelatedOpenOrder.xml
+5
-7
master/bt5/vifib_erp5/bt/revision
master/bt5/vifib_erp5/bt/revision
+1
-1
No files found.
master/bt5/vifib_erp5/ExtensionTemplateItem/VifibSecurity.py
View file @
71b79d5e
...
@@ -132,19 +132,9 @@ def getSoftwareInstanceSecurityCategory(self, base_category_list, user_name,
...
@@ -132,19 +132,9 @@ def getSoftwareInstanceSecurityCategory(self, base_category_list, user_name,
category_dict
.
setdefault
(
base_category
,
[]).
extend
([
'role'
,
'role/instance'
])
category_dict
.
setdefault
(
base_category
,
[]).
extend
([
'role'
,
'role/instance'
])
if
base_category
==
"aggregate"
:
if
base_category
==
"aggregate"
:
software_instance
=
software_instance_list
[
0
]
software_instance
=
software_instance_list
[
0
]
current_delivery_line
=
self
.
portal_catalog
.
unrestrictedGetResultValue
(
hosting_item
=
software_instance
.
getAggregateValue
(
portal_type
=
'Hosting Subscription'
)
portal_type
=
'Sale Packing List Line'
,
if
hosting_item
is
not
None
:
aggregate_uid
=
software_instance
.
getUid
(),
category_dict
.
setdefault
(
base_category
,
[]).
append
(
hosting_item
.
getRelativeUrl
())
simulation_state
=
self
.
getPortalCurrentInventoryStateList
()
+
\
self
.
getPortalFutureInventoryStateList
()
+
\
self
.
getPortalReservedInventoryStateList
()
+
\
self
.
getPortalTransitInventoryStateList
(),
sort_on
=
((
'movement.start_date'
,
'DESC'
),)
)
if
current_delivery_line
is
not
None
:
hosting_item
=
current_delivery_line
.
getAggregateValue
(
portal_type
=
'Hosting Subscription'
)
if
hosting_item
is
not
None
:
category_dict
.
setdefault
(
base_category
,
[]).
append
(
hosting_item
.
getRelativeUrl
())
category_list
.
append
(
category_dict
)
category_list
.
append
(
category_dict
)
elif
len
(
software_instance_list
)
>
1
:
elif
len
(
software_instance_list
)
>
1
:
raise
ConsistencyError
,
"Error: There is more than one Software Instance "
\
raise
ConsistencyError
,
"Error: There is more than one Software Instance "
\
...
...
master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/ERP5Type_getSecurityCategoryFromRelatedOpenOrder.xml
View file @
71b79d5e
...
@@ -71,13 +71,11 @@ if obj.getPortalType() == \'Person\':\n
...
@@ -71,13 +71,11 @@ if obj.getPortalType() == \'Person\':\n
return [{\'aggregate\': open_sale_order.getRelativeUrl()}]\n
return [{\'aggregate\': open_sale_order.getRelativeUrl()}]\n
\n
\n
if obj.getPortalType() == \'Software Instance\':\n
if obj.getPortalType() == \'Software Instance\':\n
delivery_line = obj.getAggregateRelatedValue(portal_type=\'Sale Packing List Line\')\n
hosting_subscription = obj.getAggregateValue(portal_type=\'Hosting Subscription\')\n
if delivery_line is not None:\n
if hosting_subscription is not None:\n
hosting_subscription = delivery_line.getAggregateValue(portal_type=\'Hosting Subscription\')\n
open_sale_order_line = hosting_subscription.getAggregateRelatedValue(portal_type=\'Open Sale Order Line\')\n
if hosting_subscription is not None:\n
if open_sale_order_line is not None and open_sale_order_line.getParentValue().getValidationState() == \'validated\':\n
open_sale_order_line = hosting_subscription.getAggregateRelatedValue(portal_type=\'Open Sale Order Line\')\n
return [{\'aggregate\': open_sale_order_line.getParentValue().getRelativeUrl()}]\n
if open_sale_order_line is not None and open_sale_order_line.getParentValue().getValidationState() == \'validated\':\n
return [{\'aggregate\': open_sale_order_line.getParentValue().getRelativeUrl()}]\n
\n
\n
return []\n
return []\n
</string>
</value>
</string>
</value>
...
...
master/bt5/vifib_erp5/bt/revision
View file @
71b79d5e
517
518
\ No newline at end of file
\ 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