Merge pull request #10274 from prssanna/links-fix

fix(Document Link): Error when group is set in link
This commit is contained in:
mergify[bot] 2020-05-10 18:49:54 +00:00 committed by GitHub
commit f5f3ed4488
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -452,6 +452,7 @@ class Meta(Document):
for link in self.links:
link.added = False
for group in data.transactions:
group = frappe._dict(group)
# group found
if link.group and group.label == link.group:
if link.link_doctype not in group.get('items'):
@ -460,7 +461,7 @@ class Meta(Document):
if not link.added:
# group not found, make a new group
data.transactions.append(frappe._dict(
data.transactions.append(dict(
label = link.group,
items = [link.link_doctype]
))