fix: not able to make inter-company po from so (#38826)

This commit is contained in:
rohitwaghchaure
2023-12-18 17:44:17 +05:30
committed by GitHub
parent 9216a852d4
commit 23042dfc3c
2 changed files with 15 additions and 2 deletions

View File

@@ -354,7 +354,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"
field = (
"incoming_rate"
if self.get("is_internal_supplier") and not self.doctype == "Purchase Order"
else "rate"
)
rate = flt(
frappe.db.get_value(ref_doctype, d.get(frappe.scrub(ref_doctype)), field)
* (d.conversion_factor or 1),