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

Does anyone know how to make a one2many tree to add attachments?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

ODOO 13

Model:

class MrpBomLine (models.Model):
    _inherit = 'mrp.bom' 
    bom_file_ids = fields.One2many ("ir.attachment", "res_id")
View:
<field name = "bom_file_ids" widget = "one2many" nolabel = "1" mode = "tree">
	<tree string = "BOMFiles" editable = "bottom">
		<field name = "create_date" />
		<field name = "name" />
	</tree>
</field>
This will give you a basic list view ... To attach files I am using a button like this:

 < widget  name = "attach_document"  string = "Attach BOM Excel File"  action = "message_post"  />




Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 15
3309
0
thg 3 15
3531
3
thg 7 25
8748
1
thg 5 25
1045
0
thg 1 24
1727