mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 16:04:46 +00:00
fix: Handle stringified jsons
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
# License: GNU General Public License v3. See license.txt
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
|
|
||||||
|
import json
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _, throw
|
from frappe import _, throw
|
||||||
from frappe.desk.notifications import clear_doctype_notifications
|
from frappe.desk.notifications import clear_doctype_notifications
|
||||||
@@ -861,6 +863,10 @@ def get_item_account_wise_additional_cost(purchase_document):
|
|||||||
# API method to created consolidated Purchase Invoice against multiple receipts
|
# API method to created consolidated Purchase Invoice against multiple receipts
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def create_consolidated_purchase_invoice(purchase_receipts, save=0, submit=0):
|
def create_consolidated_purchase_invoice(purchase_receipts, save=0, submit=0):
|
||||||
|
|
||||||
|
if isinstance(purchase_receipts, (str,)):
|
||||||
|
purchase_receipts = json.loads(purchase_receipts)
|
||||||
|
|
||||||
target_doc = None
|
target_doc = None
|
||||||
for purchase_receipt in purchase_receipts:
|
for purchase_receipt in purchase_receipts:
|
||||||
target_doc = make_purchase_invoice(purchase_receipt, target_doc)
|
target_doc = make_purchase_invoice(purchase_receipt, target_doc)
|
||||||
|
|||||||
Reference in New Issue
Block a user