Merge pull request #7019 from nabinhait/fix_10014

Default warehouse is mandatory only for stock item in POS. Fixed #6893
This commit is contained in:
Nabin Hait 2016-11-21 19:06:30 +05:30 committed by GitHub
commit d01d74cafd
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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"))
}
},