fix: update rfq item in postprocess

This commit is contained in:
Rucha Mahabal 2020-09-03 11:03:22 +05:30
parent a1b5d57076
commit 979ad180fa

View File

@ -267,11 +267,8 @@ def make_quotation(source_name, target_doc=None):
@frappe.whitelist()
def make_request_for_quotation(source_name, target_doc=None):
def set_missing_values(source, target):
rfq = frappe.get_doc(target)
for item in rfq.items:
# opportunity item is not multi-uom
item.conversion_factor = 1.0
def update_item(obj, target, source_parent):
target.conversion_factor = 1.0
doclist = get_mapped_doc("Opportunity", source_name, {
"Opportunity": {
@ -283,9 +280,10 @@ def make_request_for_quotation(source_name, target_doc=None):
["name", "opportunity_item"],
["parent", "opportunity"],
["uom", "uom"]
]
],
"postprocess": update_item
}
}, target_doc, set_missing_values)
}, target_doc)
return doclist