Merge pull request #7019 from nabinhait/fix_10014
Default warehouse is mandatory only for stock item in POS. Fixed #6893
diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py
index e5c86dc..e0a8121 100644
--- a/erpnext/accounts/doctype/sales_invoice/pos.py
+++ b/erpnext/accounts/doctype/sales_invoice/pos.py
@@ -122,7 +122,8 @@
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 26bf3ea..57ffcb1 100644
--- a/erpnext/accounts/page/pos/pos.js
+++ b/erpnext/accounts/page/pos/pos.js
@@ -1076,7 +1076,7 @@
},
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"))
}
},