mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-24 13:42:10 +01:00
fix(sales_order): set valid target.currency in make_purchase_order
This commit is contained in:
@@ -1612,12 +1612,14 @@ def make_purchase_order(
|
||||
|
||||
def set_missing_values(source, target):
|
||||
target.supplier = supplier
|
||||
target.currency = frappe.db.get_value(
|
||||
"Supplier", filters={"name": supplier}, fieldname=["default_currency"]
|
||||
)
|
||||
company_currency = frappe.db.get_value(
|
||||
"Company", filters={"name": target.company}, fieldname=["default_currency"]
|
||||
)
|
||||
supplier_currency = frappe.db.get_value(
|
||||
"Supplier", filters={"name": supplier}, fieldname=["default_currency"]
|
||||
)
|
||||
|
||||
target.currency = supplier_currency if supplier_currency else company_currency
|
||||
|
||||
target.conversion_rate = get_exchange_rate(target.currency, company_currency, args="for_buying")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user