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

```

duplicate_beneficiaries_ids = fields.Many2many(
        "openg2p.beneficiary",
        string='Potential Duplicates'
    )
@ api.onchange('stage_id')
    def checking_duplicates(self):
        if int(self.stage_id.id) == 2:
            my_list = self.search_beneficiary()
            if my_list:
                my_list = json.loads(my_list)
                benf_ids = [li['beneficiary'for li in my_list]
                for ids in benf_ids:
                    self.write({'duplicate_beneficiaries_ids': [(4, ids)]})

```
It gives syntax error at 'self.write',according to documentation it is correct.
The error:psycopg2.errors.SyntaxError: syntax error at or near ")" 

아바타
취소
베스트 답변

Hi,

    Try this,

    self.write({'duplicate_beneficiaries_ids'my_list and [(6, 0, my_list)] or False}) 

Hope it helps,

Thanks


아바타
취소
작성자 베스트 답변

@Karthikeyan N R

still showing the same error:

psycopg2.errors.SyntaxError: syntax error at or near ")"
LINE 3: ...ng2p_registration_rel.openg2p_registration_id IN () AND open...


아바타
취소
베스트 답변

Hi,

try with the below solution.

self.write({'duplicate_beneficiaries_ids': [(4, ids, False)]})

Thanks & Regards,

Sunny Sheth






아바타
취소
관련 게시물 답글 화면 활동
1
2월 24
2040
0
7월 24
3117
0
7월 22
60
1
7월 22
2992
2
12월 23
33506