mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 15:12:51 +00:00
[test-fix]
This commit is contained in:
@@ -4,18 +4,25 @@ def execute():
|
|||||||
# stock reco now amendable
|
# stock reco now amendable
|
||||||
frappe.db.sql("""update tabDocPerm set `amend` = 1 where parent='Stock Reconciliation' and submit = 1""")
|
frappe.db.sql("""update tabDocPerm set `amend` = 1 where parent='Stock Reconciliation' and submit = 1""")
|
||||||
|
|
||||||
|
|
||||||
if frappe.db.has_column("Stock Reconciliation", "reconciliation_json"):
|
if frappe.db.has_column("Stock Reconciliation", "reconciliation_json"):
|
||||||
for sr in frappe.db.get_all("Stock Reconciliation", ["name"],
|
for sr in frappe.db.get_all("Stock Reconciliation", ["name"],
|
||||||
{"reconciliation_json": ["!=", ""]}):
|
{"reconciliation_json": ["!=", ""]}):
|
||||||
|
start = False
|
||||||
sr = frappe.get_doc("Stock Reconciliation", sr.name)
|
sr = frappe.get_doc("Stock Reconciliation", sr.name)
|
||||||
for item in json.loads(sr.reconciliation_json):
|
for item in json.loads(sr.reconciliation_json):
|
||||||
if item.get("item_code"):
|
if start:
|
||||||
sr.append("items", {
|
if item.get("item_code"):
|
||||||
"item_code": item.item_code,
|
sr.append("items", {
|
||||||
"warehouse": item.warehouse,
|
"item_code": item[0],
|
||||||
"valuation_rate": item.valuation_rate,
|
"warehouse": item[1],
|
||||||
"qty": item.qty
|
"valuation_rate": item[3],
|
||||||
})
|
"qty": item[4]
|
||||||
|
})
|
||||||
|
|
||||||
|
elif item[0]=="Item Code":
|
||||||
|
start = True
|
||||||
|
|
||||||
|
|
||||||
for item in sr.items:
|
for item in sr.items:
|
||||||
item.db_update()
|
item.db_update()
|
||||||
|
|||||||
Reference in New Issue
Block a user