Skip to Content
Menu
This question has been flagged
2 Replies
1720 Views

Hi all,

i wrote a report for leaves. I use a custom dialog where personal manager can select an employee. We have two groups of employees, internal and external. The flag for this is a Boolean employee_id.portal_tab. To filter only internal employees i tried to set domain to employee field in custom dialog, but without success.

<record id="tm_hr_holidays_report_view" model="ir.ui.view">
<field name="name">Urlaubsübersicht Wizard</field>
<field name="model">tm.hr_holidays.report</field>
<field name="domain">[('employee_id.portal_tab', '!=', True)]</field>
<field name="arch" type="xml">
<form string="Übersicht Urlaub">
<group>
<field name="employee_id" string="Mitarbeiter" required="1"/>
</group>
<footer>
<button name="tm_hr_holidays_report" string="Print" type="object" default_focus="1"
class="oe_highlight" attrs="{'invisible': [('employee_id','=',False)
]}"/>
<button string="Cancel" class="btn btn-default" special="cancel" />
</footer>
</form>
</field>
</record>
<record id="tm_hr_holidays_report_action" model="ir.actions.act_window">
<field name="name">Urlaubsübersicht</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">tm.hr_holidays.report</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>

 Kind regards,

Franz

Avatar
Discard
Best Answer

give the domain to field employee_id where portal_tab != True


Avatar
Discard
Author Best Answer

Hi thank you very much,

now it works, i tried this before, but in the wrong report sources :-(

Kind regards,

Franz

This works for me:

<field name="employee_id" string="Mitarbeiter" required="1" domain="[('portal_tab', '!=',True)]"/>
Avatar
Discard