From 0f655e4430108ddb8d2bb8b2d35c26ab6fe376dc Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Fri, 9 Sep 2022 12:40:57 +0530 Subject: [PATCH] fix: Rate for internal PI have non stock UOM items --- erpnext/controllers/buying_controller.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 7ab8f81bd9..584266d53b 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -309,7 +309,11 @@ class BuyingController(SubcontractingController): rate = flt(outgoing_rate * (d.conversion_factor or 1), d.precision("rate")) else: field = "incoming_rate" if self.get("is_internal_supplier") else "rate" - rate = frappe.db.get_value(ref_doctype, d.get(frappe.scrub(ref_doctype)), field) + rate = flt( + frappe.db.get_value(ref_doctype, d.get(frappe.scrub(ref_doctype)), field) + * (d.conversion_factor or 1), + d.precision("rate"), + ) if self.is_internal_transfer(): if rate != d.rate: