Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
3 Ответы
10039 Представления

how to write the python search condition parameters?
I tried .....search ['name', 'ilike', 'biblio'] but this creates an error during execution.
Any direction would be greatly appreciated as I am not a developper! :-(


Аватар
Отменить
Автор

the code

Code:

partner_rec = env['res.partner'].search([])

# you can filter the unncessary partners using the condition in search

for partner in partner_rec:

partner.write({'field_name': ''})

Лучший ответ

This is an Example:

partner_rec = self.env['res.partner'].search([('name','ilike','biblio')])

Hope it can help you. You can check this documentation to get more explanation: https://www.odoo.com/documentation/12.0/reference/orm.html#common-orm-methods

Аватар
Отменить
Лучший ответ

Hello Michel,

You done well but there a syntax issue
search ['name', 'ilike', 'biblio'] this wrong
search([('name', 'ilike', 'biblio')]) this is right

Аватар
Отменить

thks Subbarao. I made the correction.

I still have an issue as the server action with this python code does not delete the partner categories as expected;

Related Posts Ответы Просмотры Активность
1
июл. 25
443
Search a message Решено
1
февр. 25
1225
0
сент. 23
2171
2
июн. 23
3959
1
авг. 22
12721