[fix] Dont set currency and exchange rate while Quotation made from Opportunity for lead

This commit is contained in:
Nabin Hait
2016-07-07 10:55:41 +05:30
parent 6a66138764
commit 821367fee8
2 changed files with 13 additions and 9 deletions

View File

@@ -192,6 +192,7 @@ def make_quotation(source_name, target_doc=None):
def set_missing_values(source, target): def set_missing_values(source, target):
quotation = frappe.get_doc(target) quotation = frappe.get_doc(target)
if quotation.customer:
company_currency = frappe.db.get_value("Company", quotation.company, "default_currency") company_currency = frappe.db.get_value("Company", quotation.company, "default_currency")
party_account_currency = get_party_account_currency("Customer", quotation.customer, quotation.company) party_account_currency = get_party_account_currency("Customer", quotation.customer, quotation.company)

View File

@@ -65,6 +65,9 @@ def before_tests():
@frappe.whitelist() @frappe.whitelist()
def get_exchange_rate(from_currency, to_currency): def get_exchange_rate(from_currency, to_currency):
if not (from_currency and to_currency):
return
if from_currency == to_currency: if from_currency == to_currency:
return 1 return 1