[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#105829

X-original-commit: ac6a7c7c34c0e4d4b4d7c7dcfb2d939a70a5bf09
Signed-off-by: Masereel Pierre <pim@odoo.com>
This commit is contained in:
Ahmad Khanalizadeh
2022-11-16 12:26:01 +01:00
parent c794f45032
commit e36077f450
@@ -66,7 +66,10 @@ odoo.define('point_of_sale.ProductsWidgetControlPanel', function(require) {
let ProductIds = await this.rpc({
model: 'product.product',
method: 'search',
args: [['&', ['name', 'ilike', this.state.searchInput + "%"], ['available_in_pos', '=', true]]],
args: [['&',['available_in_pos', '=', true], '|','|','|',
['name', 'ilike', this.state.searchInput],
['default_code', 'ilike', this.state.searchInput],
['barcode', 'ilike', this.state.searchInput]]],
context: this.env.session.user_context,
});
if(ProductIds.length) {