Commit a9942b09 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_core: fix fullInventory case

check only date of Inventory in this case
parent 60860972
Pipeline #38228 passed with stage
in 0 seconds
...@@ -155,17 +155,21 @@ class Inventory(Delivery): ...@@ -155,17 +155,21 @@ class Inventory(Delivery):
to_delete_stock_uid_add = to_delete_stock_uid_set.add to_delete_stock_uid_add = to_delete_stock_uid_set.add
to_delete_list = [] to_delete_list = []
to_delete_list_append = to_delete_list.append to_delete_list_append = to_delete_list.append
inventory_id = self.getId()
for inventory_calculation_dict in default_inventory_calculation_list: for inventory_calculation_dict in default_inventory_calculation_list:
stop_date_list = [] stop_date_list = []
list_method = inventory_calculation_dict['list_method'] if self.isFullInventory():
method = getattr(self, list_method) stop_date_list.append(self.getStopDate())
for movement in method(): else:
if (movement.getResourceValue() is not None) and (movement.getInventoriatedQuantity() not in (None, '')): list_method = inventory_calculation_dict['list_method']
stop_date = movement.getStopDate() method = getattr(self, list_method)
if stop_date not in stop_date_list: for movement in method():
stop_date_list.append(stop_date) if (movement.getResourceValue() is not None) and (movement.getInventoriatedQuantity() not in (None, '')):
stop_date_list = sorted(stop_date_list) stop_date = movement.getStopDate()
if stop_date not in stop_date_list:
stop_date_list.append(stop_date)
stop_date_list = sorted(stop_date_list)
for stop_date in stop_date_list: for stop_date in stop_date_list:
# build a dict containing all inventory for this node # build a dict containing all inventory for this node
...@@ -205,7 +209,7 @@ class Inventory(Delivery): ...@@ -205,7 +209,7 @@ class Inventory(Delivery):
not_used_inventory_dict = current_inventory_dict not_used_inventory_dict = current_inventory_dict
else: else:
not_used_inventory_dict = {} not_used_inventory_dict = {}
inventory_id = self.getId() #inventory_id = self.getId()
list_method = inventory_calculation_dict['list_method'] list_method = inventory_calculation_dict['list_method']
method = getattr(self, list_method) method = getattr(self, list_method)
......
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