Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
7680 มุมมอง

I defined a `Many2many` field for `ir.attachemnt`. The problem is i can' see the `Add an item` link to add the records.

*.py

        attachment_ids = fields.Many2many('ir.attachment', string='Attachments')

*.xml

     <notebook>

          <page string='Attachments'>

                <field name="attachment_ids"/>

             </page>

    </notebook>


I also tried this:

   <field name="attachment_ids" widget="many2many" />



Is it bug or did i miss anything? Any idea?

อวตาร
ละทิ้ง

check permission

คำตอบที่ดีที่สุด

Hello Kabeer,

I don't know if you found a solution but I came across this issue as well. The only solution I found was to give CRUD rights on both tables the many2many field, not really satisfying...

I even tried to set the relation/column1/column2 parameters and create the relation model to be able to add access rights to the relation table but it is not enough...

many2many_tags and many2many_checkboxes widgets would let you select the attachment you want but it is far from the tree view list with searchbar you get with the standard many2many.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello Kabeer,

Try this in xml file

<field name="attachment_ids" widget="many2many_tags" />

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello, Kabeer 

try this one in xml file <field name="attachment_ids" widget="many2many_binary" />

 


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ก.พ. 21
3079
1
มี.ค. 20
6619
3
ม.ค. 20
8336
1
พ.ย. 19
3483
[How?] Show songs in Album แก้ไขแล้ว
2
ก.ค. 22
2354