Commit 9ebab698 authored by Jérome Perrin's avatar Jérome Perrin

add interaction to update membership criterion category list on budget line,

add membership criterion category list from budget line into budget cell as well
add TODOs on how to do this in a better way

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26102 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent dc0ba369
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: list(cell_index) + [context.getResource(base=1),] # XXX make this in a script ? or interaction workflow ?</string> </value> <value> <string>python: list(cell_index) + context.getMembershipCriterionCategoryList() + [context.getResource(base=1),] # XXX make this in a script ? or interaction workflow ?</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -57,6 +57,21 @@ ...@@ -57,6 +57,21 @@
\n \n
base_id = \'cell\'\n base_id = \'cell\'\n
line.updateCellRange(base_id=base_id)\n line.updateCellRange(base_id=base_id)\n
\n
# TODO: here we should update membership criterion category list on existing cell\n
# and add an interaction on newCell to initialize this membership\n
\n
# also update membership criterion category list on line\n
if line.getMembershipCriterionBaseCategoryList():\n
line.setMembershipCriterionCategoryList([])\n
budget_line_category_list = line.getCategoryList()\n
for variation in budget_line_category_list:\n
if not variation:\n
continue\n
base, category = variation.split(\'/\', 1)\n
if base in line.getMembershipCriterionBaseCategoryList():\n
line.setMembershipCriterionCategoryList(\n
[variation,] + line.getMembershipCriterionCategoryList())\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -98,6 +113,11 @@ line.updateCellRange(base_id=base_id)\n ...@@ -98,6 +113,11 @@ line.updateCellRange(base_id=base_id)\n
<string>line</string> <string>line</string>
<string>base_id</string> <string>base_id</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>budget_line_category_list</string>
<string>_getiter_</string>
<string>variation</string>
<string>base</string>
<string>category</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
217 222
\ No newline at end of file \ No newline at end of file
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