i need to filter product which color is red & size is small
self.env['product.template'].search([('name', '=', 'Product A"]),(attribuet_value,'=',''),], limit=1)
how i can search it ... any help
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
i need to filter product which color is red & size is small
self.env['product.template'].search([('name', '=', 'Product A"]),(attribuet_value,'=',''),], limit=1)
how i can search it ... any help
Hi Usman,
Try this code,
products = self.env['product.template'].search([('attribute_line_ids.attribute_id', '=', "Color Name"),('attribute_line_ids.value_ids', 'in', "Small")], limit=1)
If you know the ID of Color and Size, You can use it directly.
Thanks
Hi Usman,
Try this code.
products = self.env['product.product'].search([('name', '=', 'Product A'), |
Thanks
searching with the name? Please Update your answer.
Hi Hilar
What is wrong in the search for the name?
What if the name is get changed? Do you update the code in live server with the name? The name field will not be a unique constraint, however. Think
Your point is good. and it is not a piece of new knowledge for me. We can't predefine what the end-users needs.
Right?
Good to hear from you. We should able to predefine the end-users needs anyway. That is the role of a coder.
Thank you for the valuable advice. Have a nice day
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
DaftarPost Terkait | Replies | Tampilan | Aktivitas | |
---|---|---|---|---|
|
0
Sep 23
|
6220 | ||
Insert query in odoo 13
Diselesaikan
|
|
1
Jul 20
|
4982 | |
How can i write update query in a function?
Diselesaikan
|
|
3
Jan 20
|
12673 | |
|
0
Sep 19
|
98 | ||
|
0
Des 23
|
8069 |
You have to learn basic customization in odoo: https://github.com/sehrishnaz/learnopenerp/wiki