我试图在此树视图中将字段设为只读,但此视图继承自hr.employee
,并且我们正在使用<xpath>
,并且我能够将普通字段设为只读,但 TITLE 和 ASSIGNED TO 列除外
或者是否可以从 Odoo 14 中禁用开箱即用的复选框?谢谢!!
查看定义:
<record id="view_task_tree_rw" model="ir.ui.view">
<field name="name">project.task.tree.inherited</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_tree2"/>
<field name="arch" type="xml">
<xpath expr="//tree[1]/field[@name='name']" position="after">
<field name="status"/>
<field name="date_start" widget="date"/>
<field name="date_end" widget="date" />
<field name="billable"/>
<field name="utilization"/>
<field name="planned_hours"/>
</xpath>
<xpath expr="//field[@name='company_id']" position="replace"/>
<xpath expr="//field[@name='activity_ids']" position="replace"/>
<xpath expr="//field[@name='tag_ids']" position="replace"/>
<xpath expr="//field[@name='stage_id']" position="replace"/>
<xpath expr="//field[@name='project_id']" position="replace"/>
<xpath expr="//tree[1]/field[@name='name']" position="after">
<xpath expr="//field[@name='user_id']" position="move"/>
</xpath>
</field>
</record>
截屏: