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

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

(cherry picked from commit 23042dfc3c)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot]
2023-12-18 18:13:47 +05:30
committed by GitHub
parent 8d79365e0d
commit 32a608f948
2 changed files with 15 additions and 2 deletions

View File

@@ -381,7 +381,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),