Skip to Content
Menu
This question has been flagged
1 Reply
5525 Views
<record model="ir.actions.act_window" id="action_hr_available_holidays_report">
    <field name="name">Leaves Analysis</field>
    <field name="res_model">hr.holidays</field>
    <field name="view_type">form</field>
    <field name="view_mode">tree,form</field>
    <field name="view_id" eval="view_holiday_simple"/>
    <field name="context">{'search_default_year':1, 'search_default_This Month':1, 'search_default_group_employee': 1, 'search_default_group_type': 1}</field>
    <field name="domain">[('holiday_type','=','employee')]</field>
    <field name="search_view_id" ref="view_hr_holidays_filter"/>
</record>

above shows the action tag for hr attendance report.its confused me what is the mean from these.?

    <field name="view_id" eval="view_holiday_simple"/>
    <field name="context">{'search_default_year':1, 'search_default_This Month':1, 'search_default_group_employee': 1, 'search_default_group_type': 1}</field>
    <field name="domain">[('holiday_type','=','employee')]</field>
    <field name="search_view_id" ref="view_hr_holidays_filter"/>

Need to clarify above segments. Reporting->Human Resources->Leave Analysis then i found those codes. its create a view called hr_holidays_remaining_leaves_user its empty when we check it from pgAdmin. but its shows data when we goes it through openerp

below added 'Year' filter and group by 'Employee' and 'Type' at on load how to given that .?

image description

please help me to sort out this issue thanks

Avatar
Discard
Best Answer

Hello.

What you posted is giving you the way to do it:

<field name="context">{'search_default_year':1, 'search_default_This Month':1, 'search_default_group_employee': 1, 'search_default_group_type': 1}</field>

When you send by context search_default, by default those views are going to enable that filter. You can see filter names on search view of this model. You only have to send this data by context and it's applied to every view. If you are opening a tree view from a wizard you can send context and domain too so you can set filters dinamically.

About views that are not showing on PgAdmin III. I've experienced this, but it's not a problem to me.

Try this:

   SELECT * FROM  hr_holidays_remaining_leaves_user

Well I'm not sure if this is the name of the view but this should work with any view.

I hope this can help you.

Avatar
Discard
Related Posts Replies Views Activity
1
Mar 15
5409
1
Mar 15
7969
2
Dec 23
12595
3
Jul 22
22896
2
Jun 21
18412