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): ...@@ -223,15 +223,17 @@ class Inventory(Delivery):
# we got the quantity from first level key # we got the quantity from first level key
diff_quantity = movement_quantity - inventory_value diff_quantity = movement_quantity - inventory_value
# Create tmp movement with only diff between inventory # Create tmp movement
# and previous stock values kwd = {'uid': movement.getUid(),
'start_date': stop_date}
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: if diff_quantity != 0:
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)
kwd['quantity'] = diff_quantity kwd['quantity'] = diff_quantity
category_list = self.getCategoryList() category_list = self.getCategoryList()
...@@ -251,8 +253,8 @@ class Inventory(Delivery): ...@@ -251,8 +253,8 @@ class Inventory(Delivery):
method(category_list, value, base_category) method(category_list, value, base_category)
kwd['category_list'] = category_list kwd['category_list'] = category_list
temp_delivery_line.edit(**kwd) temp_delivery_line.edit(**kwd)
stock_append(temp_delivery_line) stock_append(temp_delivery_line)
# Now create line to remove some subvariation text not present # Now create line to remove some subvariation text not present
# in new inventory # in new inventory
......
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