Skip to content

Commit

Permalink
fix: Treat Document Links entries as all non-std fields
Browse files Browse the repository at this point in the history
- Since the field name is specified use it as a non standard field because it is hard to determine which field is standard. It is often wrong to assume the first entry has the statndard field

(cherry picked from commit d412972)
  • Loading branch information
marination authored and mergify[bot] committed Dec 20, 2023
1 parent b7f6bca commit a792fa2
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions frappe/model/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,15 +694,12 @@ def add_doctype_links(self, data):
dict(label=link.group, items=[link.parent_doctype or link.link_doctype])
)

if not data.fieldname and link.link_fieldname:
data.fieldname = link.link_fieldname

if not link.is_child_table:
if link.link_fieldname != data.fieldname:
if data.fieldname:
data.non_standard_fieldnames[link.link_doctype] = link.link_fieldname
else:
data.fieldname = link.link_fieldname
data.non_standard_fieldnames[link.link_doctype] = link.link_fieldname
elif link.is_child_table:
if not data.fieldname:
data.fieldname = link.link_fieldname
data.internal_links[link.parent_doctype] = [link.table_fieldname, link.link_fieldname]

def get_row_template(self):
Expand Down

0 comments on commit a792fa2

Please sign in to comment.