mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-17 08:35:00 +00:00
Merge pull request #47448 from frappe/mergify/bp/version-15-hotfix/pr-47447
fix: dont auto-fetch latest exchange rate (backport #47447)
This commit is contained in:
@@ -111,6 +111,13 @@ frappe.ui.form.on("Opportunity", {
|
||||
},
|
||||
__("Create")
|
||||
);
|
||||
|
||||
let company_currency = erpnext.get_currency(frm.doc.company);
|
||||
if (company_currency != frm.doc.currency) {
|
||||
frm.add_custom_button(__("Fetch Latest Exchange Rate"), function () {
|
||||
frm.trigger("currency");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (!frm.doc.__islocal && frm.perm[0].write && frm.doc.docstatus == 0) {
|
||||
@@ -152,7 +159,7 @@ frappe.ui.form.on("Opportunity", {
|
||||
|
||||
currency: function (frm) {
|
||||
let company_currency = erpnext.get_currency(frm.doc.company);
|
||||
if (company_currency != frm.doc.company) {
|
||||
if (company_currency != frm.doc.currency) {
|
||||
frappe.call({
|
||||
method: "erpnext.setup.utils.get_exchange_rate",
|
||||
args: {
|
||||
@@ -278,7 +285,6 @@ erpnext.crm.Opportunity = class Opportunity extends frappe.ui.form.Controller {
|
||||
}
|
||||
|
||||
this.setup_queries();
|
||||
this.frm.trigger("currency");
|
||||
}
|
||||
|
||||
refresh() {
|
||||
|
||||
Reference in New Issue
Block a user