Commit bba681f1 authored by Aurel's avatar Aurel

create a tmp line for inventory even if delta 0, but do not put any

categories on it so that previous line will be deleted, but there will
be no new line with 0 quantity due to lack of category for insert


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17749 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bb8f4358
......@@ -223,15 +223,17 @@ class Inventory(Delivery):
# we got the quantity from first level key
diff_quantity = movement_quantity - inventory_value
# Create tmp movement with only diff between inventory
# and previous stock values
if diff_quantity != 0:
# Create tmp movement
kwd = {'uid': movement.getUid(),
'start_date': stop_date}
# create the tmp line and set category on it
temp_delivery_line = temp_constructor(self,
inventory_id)
# set category on it only if quantity not null
# thus line with same uid will be deleted but we
# don't insert line with null quantity as we test
# some categories like resource/destination/source
# before insert but not before delete
if diff_quantity != 0:
kwd['quantity'] = diff_quantity
category_list = self.getCategoryList()
......
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