Skip to Content
Menu
This question has been flagged
1207 Views

my code:

class hr_custom(models.Model):
    _inherit = 'hr.employee'
    attachment_ids = fields.Many2many('attachment.to.employee', 'attachment_id', string="Attachments")


class attachment(models.Model):    

_name = "attachment.to.employee"        

attachment_id = fields.Many2one('ir.attachment')    

attachment = fields.Binary(string="Attachments")  

---------------------------------------------------------------

file.xml:

  <page string="Job description attachment">          

              <field name="attachment_ids">                         

                       <tree editable="bottom">                    

            <field name="attachment"/>                  

            <field name="create_date"/>                

        </tree>                  

</field>                    

 </page>


Avatar
Discard