Skip to content

Commit

Permalink
fix: Rate for internal PI have non stock UOM items
Browse files Browse the repository at this point in the history
(cherry picked from commit 0f655e4)

# Conflicts:
#	erpnext/controllers/buying_controller.py
  • Loading branch information
deepeshgarg007 authored and mergify[bot] committed Sep 12, 2022
1 parent a9e9dad commit c06e241
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions erpnext/controllers/buying_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,16 @@ def set_incoming_rate(self):

rate = flt(outgoing_rate * (d.conversion_factor or 1), d.precision("rate"))
else:
<<<<<<< HEAD
rate = frappe.db.get_value(ref_doctype, d.get(frappe.scrub(ref_doctype)), "rate")
=======
field = "incoming_rate" if self.get("is_internal_supplier") else "rate"
rate = flt(
frappe.db.get_value(ref_doctype, d.get(frappe.scrub(ref_doctype)), field)
* (d.conversion_factor or 1),
d.precision("rate"),
)
>>>>>>> 0f655e4430 (fix: Rate for internal PI have non stock UOM items)

if self.is_internal_transfer():
if rate != d.rate:
Expand Down

0 comments on commit c06e241

Please sign in to comment.