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

Hello everyone,

I am using Odoo12 and have the need to add several values to tag_ids which is a many2many field type on the account.account model on write method.

I have a list of tag_ids I need to add:

Sample code:

list = [1, 2, 3, 4]
tags_to_add = self.env['account.account.tag'].search([('id', 'in', list)])

How can I add those values in "tags_to_add" to the tags_id field on write method?

Thank you very much in advance

PM

아바타
취소
베스트 답변

you can assign directly this way 

    tag_ids = tags_to_add.ids

or 

    tag_ids = [(6,0, tags_to_add.ids )]
    


아바타
취소
관련 게시물 답글 화면 활동
1
4월 25
3571
0
3월 24
1324
1
2월 24
2066
0
7월 24
3126
0
10월 22
2510