Search code examples
pythonxmltreeviewodoo-10formview

Odoo 10: How do I disable Click on Base Tree View


I'm attempting to disable the click to form view on a base level tree view (not from an x2many field) Is there a way to do this?

here is my tree view code.

<record id="view_attendance_tree_read_only" model="ir.ui.view">
    <field name="name">attendance.tree.read_only</field>
    <field name="model">hr.attendance</field>
    <field name="sequence">17</field>
    <field name="arch" type="xml">
        <tree string="Employee Attendances" edit="false" create="false" >
            <field name="employee_id"/>
            <field name="location_id" string="Location" />
            <field name="zone_id" string="Zone"/>
            <field name="job_id"/>
            <field name="check_in"/>
            <field name="check_out"/>
            <field name="auto_checkout" readonly="1"/>
        </tree>
    </field>
</record>

Is there a way to do this? if not is there a way to point this specific tree view to another specific form view? The reason we need this is so that anyone who doesn't have manager permissions can only see their attendances.


Solution

  • Answer provided to me was to change

        <field name="view_mode">tree,form</field>
    

    to

        <field name="view_mode">tree</field>
    

    in the ir.actions.act_window record and not alter the actual tree view record.