Merge pull request #27515 from Ninad1306/map_docs_fix
fix: Update Child table from the Last Source Doc
This commit is contained in:
commit
dcd14d07dc
1 changed files with 6 additions and 3 deletions
|
|
@ -129,6 +129,12 @@ def get_mapped_doc(
|
|||
table_map = {"doctype": target_child_doctype}
|
||||
|
||||
if table_map:
|
||||
target_child_doctype = table_map["doctype"]
|
||||
target_parentfield = target_doc.get_parentfield_of_doctype(target_child_doctype)
|
||||
|
||||
if table_map.get("reset_value"):
|
||||
setattr(target_doc, target_parentfield, [])
|
||||
|
||||
for source_d in source_doc.get(df.fieldname):
|
||||
if "condition" in table_map:
|
||||
if not table_map["condition"](source_d):
|
||||
|
|
@ -143,9 +149,6 @@ def get_mapped_doc(
|
|||
):
|
||||
continue
|
||||
|
||||
target_child_doctype = table_map["doctype"]
|
||||
target_parentfield = target_doc.get_parentfield_of_doctype(target_child_doctype)
|
||||
|
||||
# does row exist for a parentfield?
|
||||
if target_parentfield not in row_exists_for_parentfield:
|
||||
row_exists_for_parentfield[target_parentfield] = (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue