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

I would like to add documents to a form similar to the Projects Tasks where you can link documents to the task but it is stored in Documents. If anyone has any solutions or can point me where to look that would be great!

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

Hi,

Create a Many2many Field: The task model and the field to link documents.

class CustomTask(models.Model):

    _name = 'project.task'

    document_ids = fields.Many2many('ir.attachment', string='Documents')


<record id="view_custom_task_form" model="ir.ui.view">
<field name="name">project.task.form.view.inherits</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="project.project_sharing_project_task_view_form"/>
    <field name="arch" type="xml">
<xpath expr="//notebook/page[@name='description_page']" position="after">
             <group>
                             <field name="document_ids" widget="many2many_tags"/>
             </group>
        </xpath>
    </field>
</record>


Hope it helps

อวตาร
ละทิ้ง

Thanks, but is there a way to achieve this in Studio ?

Related Posts ตอบกลับ มุมมอง กิจกรรม
Change position chatter แก้ไขแล้ว
1
ส.ค. 25
188
4
ก.ค. 25
1561
1
ก.ค. 25
864
2
ก.ค. 25
888
1
ก.ค. 25
1992