we use odoo 11.
I don't want to update the base module(hr.employee)
I want add field attachment file to form employee.
customemodule.py:
class hr_custom(models.Model):
_name = 'hr_custom'
_inherit = 'hr.employee'
attachment_ids = fields.Many2many('ir.attachment', 'attachment_id', string="Attachments")
view.xml:
<record id="view_hr_employee_form_inherit" model="ir.ui.view">
<field name="name">hr.employee.form.inherit</field>
<field name="model"> hr_custom </field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<xpath expr="//page[1]" position="inside">
<group>
<field name="attachment_ids"/>
</group>
</xpath>
</field>
</record>
Hi Avinash, thanks,
but error: Field `attachment_ids` does not exist.
You restart the server and upgrade the module?
Excuse me,fixed . thanks a lot
My Pleasure
How to use inheritance in Odoo: https://goo.gl/4Zyc9d
Hi, Even though issue is solved, you can refer this: https://www.youtube.com/watch?v=z1Tx7EGkPy0&list=PLqRRLx0cl0hoJhjFWkFYowveq2Zn55dhM&index=9