Skip to content
Snippets Groups Projects
Commit ac6a7c7c authored by Ahmad Khanalizadeh's avatar Ahmad Khanalizadeh
Browse files

[FIX] point_of_sale: search all fields when loading from database


Before this commit: when `Limited Products Loading` is enabled in
PoS settings, and `Load all remaining products in the background` is
disabled, the search bar only uses `name` to look for products to fetch
from database. This causes problem when for example the user is using
barcodes to identify products.

To fix this, the search domain should be expanded to include all of the
fields which are normally used when searching for products.

opw-3055960

closes odoo/odoo#105748

Signed-off-by: default avatarMasereel Pierre <pim@odoo.com>
parent ad435806
Branches
Tags
No related merge requests found
......@@ -53,7 +53,10 @@ odoo.define('point_of_sale.ProductsWidgetControlPanel', function(require) {
let ProductIds = await this.rpc({
model: 'product.product',
method: 'search',
args: [['&', ['name', 'ilike', this.searchWordInput.el.value + "%"], ['available_in_pos', '=', true]]],
args: [['&',['available_in_pos', '=', true], '|','|','|',
['name', 'ilike', this.searchWordInput.el.value],
['default_code', 'ilike', this.searchWordInput.el.value],
['barcode', 'ilike', this.searchWordInput.el.value]]],
context: this.env.session.user_context,
});
if(!ProductIds.length) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment