[patch] [file data] fix
This commit is contained in:
parent
28eae6e9ff
commit
fe5fb33cc2
@ -56,13 +56,13 @@ def update_for_doc(doctype, doc):
|
|||||||
|
|
||||||
if exists:
|
if exists:
|
||||||
if webnotes.conn.exists("File Data", fileid):
|
if webnotes.conn.exists("File Data", fileid):
|
||||||
|
try:
|
||||||
fd = webnotes.bean("File Data", fileid)
|
fd = webnotes.bean("File Data", fileid)
|
||||||
if not (fd.doc.attached_to_doctype and fd.doc.attached_to_name):
|
if not (fd.doc.attached_to_doctype and fd.doc.attached_to_name):
|
||||||
fd.doc.attached_to_doctype = doctype
|
fd.doc.attached_to_doctype = doctype
|
||||||
fd.doc.attached_to_name = doc.name
|
fd.doc.attached_to_name = doc.name
|
||||||
fd.save()
|
fd.save()
|
||||||
else:
|
else:
|
||||||
try:
|
|
||||||
fd = webnotes.bean("File Data", copy=fd.doclist)
|
fd = webnotes.bean("File Data", copy=fd.doclist)
|
||||||
fd.doc.attached_to_doctype = doctype
|
fd.doc.attached_to_doctype = doctype
|
||||||
fd.doc.attached_to_name = doc.name
|
fd.doc.attached_to_name = doc.name
|
||||||
|
Loading…
x
Reference in New Issue
Block a user