Skip to Content
Menu
This question has been flagged
1 Reply
5884 Views


i want to enable employee to see all his info and other employees info ( without working hours field "resource_calendar_id" )
<record id="hide_working_hours_for_employees" model="ir.ui.view">
<field name="name">Hide Working Hours Employees Form</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='resource_calendar_id']" position="attributes">
<attribute name="attrs">{'invisible': [()]}</attribute>
</xpath>
</field>
</record>​

what is the appropriate condition to put in attrs 
thanks


Avatar
Discard

Inheritance in models and views in odoo: https://goo.gl/4Zyc9d

Best Answer
<xpath expr="//field[@name='resource_calendar_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
Avatar
Discard
Author

where is the condition ??

<xpath expr="//field[@name='resource_calendar_id']" position="attributes">

<attribute name="attrs">{'invisible': [('state', 'not in', ('draft'))]}</attribute>

</xpath>

Author

draft ???

condition : logged in user can see other employees information without 'working hours' field