Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- document = json.loads(document)
- current_attachments = []
- for file_url in frappe.db.sql("""select file_url from `tabFile` where attached_to_doctype = %(doctype)s and attached_to_name = %(docname)s""", {'doctype': document["doctype"], 'docname': document["name"]}, as_dict=True ):
- current_attachments.append(file_url.file_url)
- count = 0
- for item_doc in document["items"]:
- #frappe.msgprint(item_doc)
- # Check to see if the quantity is = 1
- item = frappe.get_doc("Item",item_doc["item_code"])
- attachments = []
- # Get the path for the attachments
- if item.drawing_attachment:
- attachments.append(item.drawing_attachment)
- if item.stp_attachment:
- attachments.append(item.stp_attachment)
- if item.dxf_attachment:
- attachments.append(item.dxf_attachment)
- if item.x_t_attachment:
- attachments.append(item.x_t_attachment)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement