Commit 8afc48e1 authored by Julien Muchembled's avatar Julien Muchembled

Tolerate that a rule does not produce any amount when output quantity can differ from input

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/amount_generator@38138 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5fd3e7a5
......@@ -718,12 +718,13 @@ class BusinessProcess(Path, XMLObject):
+ movement.getCausalityList())
result.append(movement)
# result can not be empty
if not result: raise ValueError("A Business Process can not erase amounts")
if not explanation.getSpecialiseValue().getSameTotalQuantity():
return result
# result can not be empty
if not result:
raise ValueError("A Business Process can not erase amounts")
# Sort movement list and make sure the total is equal to total_quantity
total_quantity = amount.getQuantity()
current_quantity = 0
......
......@@ -83,9 +83,7 @@ class TestBPMMixin(ERP5TypeTestCase):
business_process._edit(**kw)
self.createTradeModelPath(business_process,
reference='default_path',
trade_phase_value_list=('default/payment',
'default/discount',
'default/tax'),
trade_phase_value_list=('default/discount', 'default/tax'),
trade_date='trade_phase/default/invoicing')
kw = dict(business_process=business_process,
trade_phase='default/accounting',
......
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