تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
5244 أدوات العرض

I am trying to create/update a record based on button click.

lines = [line.analytic_tag_ids.id for line in self.line_ids]
line1 = lines[0]

for index,line in enumerate(lines):
# print('line1', lines[line1])
lines[line] = lines[0]
print(new1)
for rec in self.line_ids:
rec.write({'analytic_tag_ids':lines[0]})
Here is the code but it isnt the right one as it says int in my list cannot be given as a value for analytic tag. Can u pleasegive me an example on how to use list data in write method
الصورة الرمزية
إهمال

Your code is totally wrong. You are fetching analytic_tag_ids from self.line_ids and again writing the tags to the same field "analytic_tag_ids".

Please share your idea about what you want to do.

الكاتب

Oh now i get it , it was related to the other question u just answered, i was just trying to get all values of analytic tags in a list and then on button click i was trying to assign them the id of first tag in the lines

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مارس 21
3268
0
مارس 15
3938
0
يوليو 22
3351
1
يونيو 20
3553
1
ديسمبر 16
4580