fix(pos): check if item exists before fetching available qty (#27581)
This commit is contained in:
parent
190c2d84da
commit
6d8e869a92
@ -236,7 +236,7 @@ erpnext.PointOfSale.ItemDetails = class {
|
||||
if (this.value) {
|
||||
me.events.form_updated(me.current_item, 'warehouse', this.value).then(() => {
|
||||
me.item_stock_map = me.events.get_item_stock_map();
|
||||
const available_qty = me.item_stock_map[me.item_row.item_code][this.value];
|
||||
const available_qty = me.item_stock_map[me.item_row.item_code] && me.item_stock_map[me.item_row.item_code][this.value];
|
||||
if (available_qty === undefined) {
|
||||
me.events.get_available_stock(me.item_row.item_code, this.value).then(() => {
|
||||
// item stock map is updated now reset warehouse
|
||||
|
Loading…
Reference in New Issue
Block a user