i am trying ecommerce shop using odoo13 ce.
my problem is
shop search bar can search internal reference but can not search barcode.
how to search include barcode from shop search bar?
Thanks
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
i am trying ecommerce shop using odoo13 ce.
my problem is
shop search bar can search internal reference but can not search barcode.
how to search include barcode from shop search bar?
Thanks
Hi,
If you need to search the products with barcode in the website, you have to inherit and modify the function named: _get_search_domain inside the website_sale module.
def _get_search_domain(self, search, category, attrib_values, search_in_description=True):
domains = [request.website.sale_product_domain()]
if search:
for srch in search.split(" "):
subdomains = [
[('name', 'ilike', srch)],
[('product_variant_ids.default_code', 'ilike', srch)]
]
if search_in_description:
subdomains.append([('barcode', 'ilike', srch)])
subdomains.append([('description', 'ilike', srch)])
subdomains.append([('description_sale', 'ilike', srch)])
domains.append(expression.OR(subdomains))
Thanks
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
1
thg 8 24
|
1577 | ||
|
1
thg 5 25
|
1848 | ||
|
2
thg 4 24
|
1350 | ||
|
0
thg 12 23
|
1479 | ||
|
2
thg 6 21
|
3109 |
Do you mean that shop visitors enter a 13 digit barcode for example?
yes,
visitors enter a 13 digit barcode