Commit 291c2ab5 authored by Jérome Perrin's avatar Jérome Perrin

ERP5: introduce source/destination arrow category type

Instead of hardcoding categories group in TradeModelPath, introduce
two new groups (as planned in the XXX comments) to list source
and destination arrow base categories.
parent 2e67044a
......@@ -53,7 +53,9 @@
<item>
<key> <string>category_type</string> </key>
<value>
<tuple/>
<tuple>
<string>destination_arrow</string>
</tuple>
</value>
</item>
<item>
......
......@@ -27,6 +27,14 @@
</tuple>
</value>
</item>
<item>
<key> <string>category_type</string> </key>
<value>
<tuple>
<string>source_arrow</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
......
......@@ -28,6 +28,14 @@
</tuple>
</value>
</item>
<item>
<key> <string>category_type</string> </key>
<value>
<tuple>
<string>source_arrow</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
......
......@@ -114,22 +114,7 @@ class TradeModelPath(Path):
Returns all categories which are used to define the source
of this Arrow
"""
# Naive implementation - we must use category groups instead - XXX
return ('source',
'source_account',
'source_administration',
#'source_advice',
'source_carrier',
'source_decision',
'source_function',
'source_funding',
'source_payment',
'source_project',
'source_referral',
'source_section',
'source_trade',
#'source_transport'
)
return self.getPortalObject().getPortalSourceArrowBaseCategoryList()
security.declareProtected(Permissions.AccessContentsInformation,
'getDestinationArrowBaseCategoryList')
......@@ -138,22 +123,7 @@ class TradeModelPath(Path):
Returns all categories which are used to define the destination
of this Arrow
"""
# Naive implementation - we must use category groups instead - XXX-JPS review this later
return ('destination',
'destination_account',
'destination_administration',
#'destination_advice',
#'destination_carrier',
'destination_decision',
'destination_function',
'destination_funding',
'destination_payment',
'destination_project',
'destination_referral',
'destination_section',
'destination_trade',
#'destination_transport'
)
return self.getPortalObject().getPortalDestinationArrowBaseCategoryList()
# XXX-JPS UNkonwn ?
security.declareProtected(Permissions.AccessContentsInformation,
......
......@@ -938,6 +938,22 @@ class ERP5Site(ResponseHeaderGenerator, FolderMixIn, PortalObjectBase, CacheCook
"""
return self._getPortalGroupedCategoryList('sub_variation')
security.declareProtected(Permissions.AccessContentsInformation,
'getPortalSourceArrowBaseCategoryList')
def getPortalSourceArrowBaseCategoryList(self):
"""
Return source arrow base categories.
"""
return self._getPortalGroupedCategoryList('source_arrow')
security.declareProtected(Permissions.AccessContentsInformation,
'getPortalDestinationArrowBaseCategoryList')
def getPortalDestinationArrowBaseCategoryList(self):
"""
Return destination arrow base categories.
"""
return self._getPortalGroupedCategoryList('destination_arrow')
security.declareProtected(Permissions.AccessContentsInformation,
'getPortalVariationTypeList')
def getPortalVariationTypeList(self):
......
......@@ -68,7 +68,9 @@
<item>
<key> <string>category_type</string> </key>
<value>
<tuple/>
<tuple>
<string>destination_arrow</string>
</tuple>
</value>
</item>
<item>
......
......@@ -52,7 +52,9 @@
<item>
<key> <string>category_type</string> </key>
<value>
<tuple/>
<tuple>
<string>destination_arrow</string>
</tuple>
</value>
</item>
<item>
......
......@@ -50,7 +50,9 @@
<item>
<key> <string>category_type</string> </key>
<value>
<tuple/>
<tuple>
<string>destination_arrow</string>
</tuple>
</value>
</item>
<item>
......
......@@ -50,7 +50,9 @@
<item>
<key> <string>category_type</string> </key>
<value>
<tuple/>
<tuple>
<string>destination_arrow</string>
</tuple>
</value>
</item>
<item>
......
......@@ -70,7 +70,9 @@
<item>
<key> <string>category_type</string> </key>
<value>
<tuple/>
<tuple>
<string>destination_arrow</string>
</tuple>
</value>
</item>
<item>
......
......@@ -118,7 +118,9 @@
<item>
<key> <string>category_type</string> </key>
<value>
<tuple/>
<tuple>
<string>destination_arrow</string>
</tuple>
</value>
</item>
<item>
......
......@@ -50,7 +50,9 @@
<item>
<key> <string>category_type</string> </key>
<value>
<tuple/>
<tuple>
<string>destination_arrow</string>
</tuple>
</value>
</item>
<item>
......
......@@ -71,7 +71,9 @@
<item>
<key> <string>category_type</string> </key>
<value>
<tuple/>
<tuple>
<string>destination_arrow</string>
</tuple>
</value>
</item>
<item>
......
......@@ -68,7 +68,9 @@
<item>
<key> <string>category_type</string> </key>
<value>
<tuple/>
<tuple>
<string>destination_arrow</string>
</tuple>
</value>
</item>
<item>
......
......@@ -71,7 +71,9 @@
<item>
<key> <string>category_type</string> </key>
<value>
<tuple/>
<tuple>
<string>destination_arrow</string>
</tuple>
</value>
</item>
<item>
......
......@@ -115,7 +115,9 @@
<item>
<key> <string>category_type</string> </key>
<value>
<tuple/>
<tuple>
<string>source_arrow</string>
</tuple>
</value>
</item>
<item>
......
......@@ -53,7 +53,9 @@
<item>
<key> <string>category_type</string> </key>
<value>
<tuple/>
<tuple>
<string>source_arrow</string>
</tuple>
</value>
</item>
<item>
......
......@@ -50,7 +50,9 @@
<item>
<key> <string>category_type</string> </key>
<value>
<tuple/>
<tuple>
<string>source_arrow</string>
</tuple>
</value>
</item>
<item>
......
......@@ -50,7 +50,9 @@
<item>
<key> <string>category_type</string> </key>
<value>
<tuple/>
<tuple>
<string>source_arrow</string>
</tuple>
</value>
</item>
<item>
......
......@@ -70,7 +70,9 @@
<item>
<key> <string>category_type</string> </key>
<value>
<tuple/>
<tuple>
<string>source_arrow</string>
</tuple>
</value>
</item>
<item>
......
......@@ -118,7 +118,9 @@
<item>
<key> <string>category_type</string> </key>
<value>
<tuple/>
<tuple>
<string>source_arrow</string>
</tuple>
</value>
</item>
<item>
......
......@@ -50,7 +50,9 @@
<item>
<key> <string>category_type</string> </key>
<value>
<tuple/>
<tuple>
<string>source_arrow</string>
</tuple>
</value>
</item>
<item>
......
......@@ -118,7 +118,9 @@
<item>
<key> <string>category_type</string> </key>
<value>
<tuple/>
<tuple>
<string>source_arrow</string>
</tuple>
</value>
</item>
<item>
......
......@@ -68,7 +68,9 @@
<item>
<key> <string>category_type</string> </key>
<value>
<tuple/>
<tuple>
<string>source_arrow</string>
</tuple>
</value>
</item>
<item>
......
......@@ -72,7 +72,9 @@
<item>
<key> <string>category_type</string> </key>
<value>
<tuple/>
<tuple>
<string>source_arrow</string>
</tuple>
</value>
</item>
<item>
......
......@@ -10,9 +10,9 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
<string>items</string>
<string>size</string>
<string>title</string>
</list>
</value>
</item>
......@@ -113,6 +113,14 @@
<string>sub_variation</string>
<string>sub_variation</string>
</tuple>
<tuple>
<string>Source Arrow</string>
<string>source_arrow</string>
</tuple>
<tuple>
<string>Destination Arrow</string>
<string>destination_arrow</string>
</tuple>
</list>
</value>
</item>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment