My program
class ProjectTask(models.Model):
_inherit = "project.task"
class AccountAnalyticLine(models.Model):
_inherit = 'account.analytic.line'
employee_id = fields.Many2one('hr.employee', string="Employee")
xml
<xpath expr="//page/field[@name='timesheet_ids']/tree/field[@name='user_id']" position="after">
<field name="employee_id"/>
</xpath>
Notes
I inherited the view and add the above but I get an error external id not found.Please help me how to solve this issue. Thanks in advance
The field you are trying to change is not in viewtaskform2
please try this :
<record model="ir.ui.view" id="view_task_form2_inherit_timesheet">
<field name="name">employee taks form</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="hr_timesheet.view_task_form2_inherited"/>
<field name="arch" type="xml">
<xpath expr="//notebook/page/field[@name='timesheet_ids']/tree/field[@name='user_id']" position="after">
<field name="employee_id"/>
</xpath>
</field>
</record>