Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
5975 Lượt xem

After searching over internet I've got to this point but can't go further. I guess this is the way a many2many field should be called but I can't understand neither find which field is supposed to go on the last part. Just want to add a tag to a sale order automatically.

record.write({'tag_ids': [(6, 0, ??)]})

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất
'tag_ids': [(6, 0, tag_ids)]

That's assuming that the many2many field is tag_ids


Ảnh đại diện
Huỷ bỏ

Excuse me for asking, but how can I get the ID of a certain tag under a certain tag category to insert it above in place of tag_ids?

Hi Hossam Abdelkader. In order to see the IDs, you have to add "id" field into the list view. To do so, first be sure that the developer mode is activated. Then go to the list of your tags. Click on the small bug icon (Open Deveoper Tools) on top right side of the navbar and choose "Edit View: List". Here, you can add the id field: `<field name="id"/>`. After you save it, you need to refresh the page and then you will see the IDs on the list.

The simplest way to get the IDs is to export the records and include the ID field. Or if it's just one then enable Developer Mode and View Metadata.

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 1 23
4043
0
thg 12 24
3856
0
thg 11 19
4658
2
thg 3 24
4906
1
thg 7 15
4015