콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
10022 화면

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;

관련 게시물 답글 화면 활동
1
7월 25
425
Search a message 해결 완료
1
2월 25
1219
0
9월 23
2161
2
6월 23
3939
1
8월 22
12715