diff --git a/erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py b/erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py index 55117ceb2e..3184f69aa4 100644 --- a/erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py +++ b/erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py @@ -186,3 +186,10 @@ class TestRepostItemValuation(FrappeTestCase): riv.db_set("status", "Skipped") riv.reload() riv.cancel() # it should cancel now + + def test_queue_progress_serialization(self): + # Make sure set/tuple -> list behaviour is retained. + self.assertEqual( + [["a", "b"], ["c", "d"]], + sorted(frappe.parse_json(frappe.as_json(set([("a", "b"), ("c", "d")])))), + ) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index f46332b726..a781479cf6 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -272,8 +272,6 @@ def validate_item_warehouse(args): def update_args_in_repost_item_valuation( doc, index, args, distinct_item_warehouses, affected_transactions ): - affected_transactions_list = [list(transaction) for transaction in affected_transactions] - doc.db_set( { "items_to_be_repost": json.dumps(args, default=str), @@ -281,7 +279,7 @@ def update_args_in_repost_item_valuation( {str(k): v for k, v in distinct_item_warehouses.items()}, default=str ), "current_index": index, - "affected_transactions": json.dumps(affected_transactions_list), + "affected_transactions": frappe.as_json(affected_transactions), } )