Commit 4b81dfd3 authored by Fabien Morin's avatar Fabien Morin

- if the price is 0, we don't want to set it to 1. We want that only in the...

- if the price is 0, we don't want to set it to 1. We want that only in the case it has not been defined (== None)
- typo


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27654 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent db0a0e4a
......@@ -127,7 +127,7 @@ class TradeModelLine(Predicate, XMLMatrix, Amount):
self_id = self.getParentValue().getId() + '_' + self.getId()
tmp_movement_list = [q for q in current_aggregated_amount_list \
if q.getReference() == self.getReference() ]
if q.getReference() == self.getReference()]
if len(tmp_movement_list) > 0:
tmp_movement_list = tmp_movement_list[:1] # list is needed in case of
# having cells
......@@ -200,7 +200,7 @@ class TradeModelLine(Predicate, XMLMatrix, Amount):
else:
# if the quantity is defined, use it
modified = 1
if tmp_movement.getPrice() in (0, None):
if tmp_movement.getPrice() is None:
# if price is not defined, it the same as 100 %
tmp_movement.setPrice(1)
......
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