From d5fd5359095dabe9ee9e4c145d470a926ffc0446 Mon Sep 17 00:00:00 2001 From: nabinhait Date: Mon, 14 Jul 2014 12:39:50 +0530 Subject: [PATCH] Minor fix, if no default company --- erpnext/public/js/queries.js | 2 +- erpnext/stock/doctype/stock_entry/stock_entry.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/public/js/queries.js b/erpnext/public/js/queries.js index b57b765ad6..4bb3302bd8 100644 --- a/erpnext/public/js/queries.js +++ b/erpnext/public/js/queries.js @@ -71,7 +71,7 @@ $.extend(erpnext.queries, { warehouse: function(doc) { return { - filters: [["Warehouse", "company", "in", ["", doc.company]]] + filters: [["Warehouse", "company", "in", ["", cstr(doc.company)]]] } } }); diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 10241983ad..7274ece1fa 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -92,7 +92,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ set_default_account: function() { var me = this; - if(cint(frappe.defaults.get_default("auto_accounting_for_stock"))) { + if(cint(frappe.defaults.get_default("auto_accounting_for_stock")) && this.frm.doc.company) { var account_for = "stock_adjustment_account"; if (this.frm.doc.purpose == "Purchase Return")