Commit e8bf1284 authored by Yusei Tahara's avatar Yusei Tahara

[erp5_core] Add getVariationCategoryValueListDict to InventoryListBrain.

To use variation is still too complex.
parent 44a716cb
......@@ -309,6 +309,20 @@ class InventoryListBrain(ComputedAttributeGetItemCompatibleMixin):
mapping=mapping)
return translateString('Unknown')
def getVariationCategoryValueListDict(self):
result = {}
if not self.variation_text:
return result
category_tool = self.portal_categories
for category_path in self.variation_text.split('\n'):
category_value = category_tool.getCategoryValue(category_path)
base_category_id = category_tool.getBaseCategoryId(category_path)
if not base_category_id in result:
result[base_category_id] = []
result[base_category_id].append(category_value)
return result
class TrackingListBrain(InventoryListBrain):
"""
List of aggregated movements
......
......@@ -45,7 +45,9 @@
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
<tuple>
<string>W: 17, 0: Unused getToolByName imported from Products.CMFCore.utils (unused-import)</string>
</tuple>
</value>
</item>
<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