From 977eff911f75e9a36920c079c190cb01ff4cc18d Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 21 Nov 2016 18:29:16 +0530 Subject: [PATCH] Default warehouse is mandatory only for stock item in POS. Fixed #6893 --- erpnext/accounts/doctype/sales_invoice/pos.py | 3 ++- erpnext/accounts/page/pos/pos.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py index e5c86dc436..e0a81216c8 100644 --- a/erpnext/accounts/doctype/sales_invoice/pos.py +++ b/erpnext/accounts/doctype/sales_invoice/pos.py @@ -122,7 +122,8 @@ def get_items_list(pos_profile): return frappe.db.sql(""" select name, item_code, item_name, description, item_group, expense_account, has_batch_no, - has_serial_no, expense_account, selling_cost_center, stock_uom, image, default_warehouse + has_serial_no, expense_account, selling_cost_center, stock_uom, image, + default_warehouse, is_stock_item from tabItem where diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js index 26bf3ea54c..57ffcb1346 100644 --- a/erpnext/accounts/page/pos/pos.js +++ b/erpnext/accounts/page/pos/pos.js @@ -1076,7 +1076,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ }, validate_warehouse: function(){ - if(!this.items[0].default_warehouse && !this.pos_profile_data['warehouse']){ + if(this.items[0].is_stock_item && !this.items[0].default_warehouse && !this.pos_profile_data['warehouse']){ frappe.throw(__("Default warehouse is required for selected item")) } },