Merge pull request #11510 from rohitwaghchaure/issue_11502
Add item directly in the cart only if serial no, batch, barcode has enter in the search field
This commit is contained in:
commit
44ef8654f9
@ -990,18 +990,18 @@ class POSItems {
|
||||
}
|
||||
|
||||
this.get_items({search_value: search_term, item_group })
|
||||
.then(({ items, serial_no, batch_no }) => {
|
||||
.then(({ items, serial_no, batch_no, barcode }) => {
|
||||
if (search_term) {
|
||||
this.search_index[search_term] = items;
|
||||
}
|
||||
|
||||
this.items = items;
|
||||
this.render_items(items);
|
||||
this.set_item_in_the_cart(items, serial_no, batch_no);
|
||||
this.set_item_in_the_cart(items, serial_no, batch_no, barcode);
|
||||
});
|
||||
}
|
||||
|
||||
set_item_in_the_cart(items, serial_no, batch_no) {
|
||||
set_item_in_the_cart(items, serial_no, batch_no, barcode) {
|
||||
if (serial_no) {
|
||||
this.events.update_cart(items[0].item_code,
|
||||
'serial_no', serial_no);
|
||||
@ -1016,7 +1016,7 @@ class POSItems {
|
||||
return;
|
||||
}
|
||||
|
||||
if (items.length === 1) {
|
||||
if (items.length === 1 && (serial_no || batch_no || barcode)) {
|
||||
this.events.update_cart(items[0].item_code,
|
||||
'qty', '+1');
|
||||
this.reset_search_field();
|
||||
|
@ -67,6 +67,11 @@ def get_items(start, page_length, price_list, item_group, search_value=""):
|
||||
'batch_no': batch_no
|
||||
})
|
||||
|
||||
if barcode:
|
||||
res.update({
|
||||
'barcode': barcode
|
||||
})
|
||||
|
||||
return res
|
||||
|
||||
def get_conditions(item_code, serial_no, batch_no, barcode):
|
||||
|
Loading…
Reference in New Issue
Block a user