Don't set currency as company currency if default currency is different (#11011)
diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
index 815e504..1d57a2f 100644
--- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
+++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
@@ -12,10 +12,6 @@
from erpnext.manufacturing.doctype.production_order.production_order import get_item_details
class ProductionPlanningTool(Document):
- def __init__(self, arg1, arg2=None):
- super(ProductionPlanningTool, self).__init__(arg1, arg2)
- self.item_dict = {}
-
def clear_table(self, table_name):
self.set(table_name, [])
@@ -398,6 +394,9 @@
return bom_wise_item_details
def make_items_dict(self, item_list):
+ if not getattr(self, "item_dict", None):
+ self.item_dict = {}
+
for i in item_list:
self.item_dict.setdefault(i[0], []).append([flt(i[1]), i[2], i[3], i[4], i[5]])
diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js
index 908d591..c83e6df 100644
--- a/erpnext/public/js/controllers/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -379,7 +379,7 @@
var company_currency = me.get_company_currency();
var company_doc = frappe.get_doc(":Company", me.frm.doc.company);
- if (!me.frm.doc.currency || me.frm.doc.currency != company_currency) {
+ if (!me.frm.doc.currency) {
me.frm.set_value("currency", company_currency);
}