I am currently using the eCommerce module to set up a list of products in the website.
Currently in the website's eShop page I can search the products by their name and IDs which I assume are the default fields that the searchbox will check.
The question is, is there a way to add more fields to search by from the eShop page? I added a custom string field for products called 'x_school_name', is there a way to make it so that the website searchbox also checks for this custom field? Where or which view should I edit?
Thank you.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Бухгалтерия
- Склад
- PoS
- Проекты
- MRP
Этот вопрос был отмечен
1
Ответить
4370
Представления
Hi,
Try this in your controller.
def _get_search_domain(self, search, category, attrib_values, search_in_description=True):
# For getting the product domain
domain = super()._get_search_domain(
search, category, attrib_values,
search_in_description=search_in_description
)
if search:
domain = expression.OR(
[domain, [('product_variant_ids.x_school_name','ilike', search)]])
return domainRegardsInherited the WebsiteSale in my class and tried this code, facing this issue, do you have any idea?
ERROR: column ir_attachment.original_id does not exist
LINE 1: ...d", "ir_attachment"."write_date" as "write_date", "ir_attach.
Не оставайтесь в стороне – присоединяйтесь к обсуждению!
Создайте аккаунт сегодня, чтобы получить доступ к эксклюзивным функциям и стать частью нашего замечательного сообщества!
Регистрация| Похожие посты | Ответы | Просмотры | Активность | |
|---|---|---|---|---|
|
|
0
янв. 25
|
962 | ||
|
|
0
мар. 24
|
1702 | ||
|
|
1
мар. 15
|
6628 | ||
|
|
1
мар. 24
|
3435 | ||
|
|
0
авг. 17
|
4987 |