Commit d74b90c7 authored by Jérome Perrin's avatar Jérome Perrin

also check for isMovement in Movement_isQuantityEditable

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41291 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a910e31b
...@@ -50,9 +50,24 @@ ...@@ -50,9 +50,24 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""This scripts is used to know if quantity can be edited by user.\n <value> <string>"""This script is used to know if quantity can be edited by user.\n
If items are used, quantity is set by the item quantity.\n \n
* If this is not a movement (line containing lines or cell), user\n
cannot edit this line which is just a container, but no actual movement.\n
\n
* If this line has variation category list, then it means it\'s a line that\n
will contain cell, so it\'s already not possible to set quantity, user have\n
to create cells and set quantities on cells.\n
\n
* If items are used, quantity is set by the item quantity.\n
"""\n """\n
\n
if not context.isMovement():\n
return False\n
\n
if context.getVariationCategoryList() and not \'Cell\' in context.getPortalType():\n
return False\n
\n
return not (context.getPortalType() in context.getPortalDeliveryMovementTypeList()\n return not (context.getPortalType() in context.getPortalDeliveryMovementTypeList()\n
and (context.getResource() and context.getResourceValue().getAggregatedPortalTypeList()))\n and (context.getResource() and context.getResourceValue().getAggregatedPortalTypeList()))\n
</string> </value> </string> </value>
...@@ -93,6 +108,7 @@ return not (context.getPortalType() in context.getPortalDeliveryMovementTypeList ...@@ -93,6 +108,7 @@ return not (context.getPortalType() in context.getPortalDeliveryMovementTypeList
<tuple> <tuple>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>False</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
1072 1073
\ 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