Is there a way to modify the product search so it by default it searches product name, internal reference, sales description and product description?
Database v17.0
Thanks for the help.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Is there a way to modify the product search so it by default it searches product name, internal reference, sales description and product description?
Database v17.0
Thanks for the help.
Can I make this type of edit in Odoo SaaS?
Thanks.
If it's a technical customizations, you can modify the original "_name_search()" method, either by overriding or replacing it, as for example you can see as follows:
class ProductTemplate(models.Model):
_inherit = 'product.template'
@api.model
def _name_search(self, name='', args=None, operator='ilike', limit=100, name_get_uid=None):
args = list(args or [])
if name :
args += ['|', '|' , ('name', operator, name), ('default_code', operator, name), ('sale_desc', operator, name), ('prod_desc', operator, name)]
return self._search(args, limit=limit, access_rights_uid=name_get_uid)
See better example from Cybrosis here: https://www.cybrosys.com/blog/how-to-create-name-search-function-in-odoo-17
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 | |
---|---|---|---|---|
|
2
thg 3 25
|
997 | ||
|
1
thg 8 25
|
405 | ||
|
2
thg 6 25
|
1833 | ||
|
0
thg 3 25
|
1695 | ||
|
0
thg 2 25
|
1334 |