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:
Saurabh 2017-11-10 15:51:14 +05:30 committed by GitHub
commit 44ef8654f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -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();

View File

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