From 15636a3b98d705838ef27ed9a7a07848074425dc Mon Sep 17 00:00:00 2001 From: Saif Date: Mon, 20 Aug 2018 17:27:00 +0500 Subject: [PATCH] Problem: Making a PE from PO led to incorrect values in PE form since PO's default party_account_currency is the company's currency (#15153) Fix: PO will set party_account_currency to supplier's default currency on validation. --- erpnext/buying/doctype/purchase_order/purchase_order.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index a543c20066..ed761ceb90 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -13,6 +13,7 @@ from erpnext.stock.stock_balance import update_bin_qty, get_ordered_qty from frappe.desk.notifications import clear_doctype_notifications from erpnext.buying.utils import validate_for_items, check_for_closed_status from erpnext.stock.utils import get_bin +from erpnext.accounts.party import get_party_account_currency from six import string_types from erpnext.stock.doctype.item.item import get_item_defaults from erpnext.setup.doctype.item_group.item_group import get_item_group_defaults @@ -87,6 +88,8 @@ class PurchaseOrder(BuyingController): standing = frappe.db.get_value("Supplier Scorecard",self.supplier, 'status') frappe.msgprint(_("{0} currently has a {1} Supplier Scorecard standing, and Purchase Orders to this supplier should be issued with caution.").format(self.supplier, standing), title=_("Caution"), indicator='orange') + self.party_account_currency = get_party_account_currency("Supplier", self.supplier, self.company) + def validate_minimum_order_qty(self): items = list(set([d.item_code for d in self.get("items")]))