<record id="hr_employee_view_form_inherit" model="ir.ui.view">
<field name="name">hr.employee.view.form.inherit</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<xpath expr="//sheet//notebook//page[@name='hr_settings']" position="after">
<page name="test" string="test" groups="hr.group_hr_user"
attrs="{'invisible': [('department_id.name', '!=', 'Sales')]}">
<group>
<field name="test_value"/>
</group>
</page>
</xpath>
</field>
</record>
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
1
Reply
842
Views
I solved it by defining a boolean feild
is_sale = fields.Boolean(string="is sales", compute='_is_sale_person')
@api.onchange('department_id')
def _is_sale_person(self):
if self.department_id.name.__eq__('Sales Dept'):
self.is_sale = True
print(self.is_sale)
else:
self.is_sale = False
print(self.is_sale)
and add this to page tage
attrs="{'invisible': [('is_sale', '=', False)]}">
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up