Advertisement
Guest User

Untitled

a guest
Nov 21st, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. document = json.loads(document)
  2.  
  3. current_attachments = []
  4. 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 ):
  5. current_attachments.append(file_url.file_url)
  6. count = 0
  7. for item_doc in document["items"]:
  8. #frappe.msgprint(item_doc)
  9. # Check to see if the quantity is = 1
  10. item = frappe.get_doc("Item",item_doc["item_code"])
  11.  
  12. attachments = []
  13. # Get the path for the attachments
  14. if item.drawing_attachment:
  15. attachments.append(item.drawing_attachment)
  16. if item.stp_attachment:
  17. attachments.append(item.stp_attachment)
  18. if item.dxf_attachment:
  19. attachments.append(item.dxf_attachment)
  20. if item.x_t_attachment:
  21. attachments.append(item.x_t_attachment)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement