fix: key error during reposting
This commit is contained in:
parent
c40719caa5
commit
ebc8230d45
@ -439,7 +439,7 @@ def get_distinct_item_warehouse(args=None, doc=None, reposting_data=None):
|
|||||||
reposting_data = get_reposting_data(doc.reposting_data_file)
|
reposting_data = get_reposting_data(doc.reposting_data_file)
|
||||||
|
|
||||||
if reposting_data and reposting_data.distinct_item_and_warehouse:
|
if reposting_data and reposting_data.distinct_item_and_warehouse:
|
||||||
return reposting_data.distinct_item_and_warehouse
|
return parse_distinct_items_and_warehouses(reposting_data.distinct_item_and_warehouse)
|
||||||
|
|
||||||
distinct_item_warehouses = {}
|
distinct_item_warehouses = {}
|
||||||
|
|
||||||
@ -457,6 +457,16 @@ def get_distinct_item_warehouse(args=None, doc=None, reposting_data=None):
|
|||||||
return distinct_item_warehouses
|
return distinct_item_warehouses
|
||||||
|
|
||||||
|
|
||||||
|
def parse_distinct_items_and_warehouses(distinct_items_and_warehouses):
|
||||||
|
new_dict = frappe._dict({})
|
||||||
|
|
||||||
|
# convert string keys to tuple
|
||||||
|
for k, v in distinct_items_and_warehouses.items():
|
||||||
|
new_dict[frappe.safe_eval(k)] = frappe._dict(v)
|
||||||
|
|
||||||
|
return new_dict
|
||||||
|
|
||||||
|
|
||||||
def get_affected_transactions(doc, reposting_data=None) -> Set[Tuple[str, str]]:
|
def get_affected_transactions(doc, reposting_data=None) -> Set[Tuple[str, str]]:
|
||||||
if not reposting_data and doc and doc.reposting_data_file:
|
if not reposting_data and doc and doc.reposting_data_file:
|
||||||
reposting_data = get_reposting_data(doc.reposting_data_file)
|
reposting_data = get_reposting_data(doc.reposting_data_file)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user