Commit c1093235 authored by Fabien Morin's avatar Fabien Morin

check if the line could be applied or not (using predicate)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27359 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4cad277a
...@@ -74,6 +74,11 @@ class TradeModelLine(XMLMatrix, Amount, Variated): ...@@ -74,6 +74,11 @@ class TradeModelLine(XMLMatrix, Amount, Variated):
current_aggregated_amount_list = None, base_id='movement', **kw): current_aggregated_amount_list = None, base_id='movement', **kw):
from Products.ERP5Type.Document import newTempSimulationMovement from Products.ERP5Type.Document import newTempSimulationMovement
# test with predicate if this model line could be applied
if not self.test(context):
# This model_line should not be applied
return []
normal_resource_use_category_list = self.\ normal_resource_use_category_list = self.\
portal_preferences.getPreferredNormalResourceUseCategoryList() portal_preferences.getPreferredNormalResourceUseCategoryList()
if normal_resource_use_category_list is None: if normal_resource_use_category_list is None:
...@@ -175,4 +180,3 @@ class TradeModelLine(XMLMatrix, Amount, Variated): ...@@ -175,4 +180,3 @@ class TradeModelLine(XMLMatrix, Amount, Variated):
aggregated_amount_list.append(tmp_movement) aggregated_amount_list.append(tmp_movement)
return aggregated_amount_list return aggregated_amount_list
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