Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
8165 Vizualizări

I've set up a tree view and a search view for a simple model:

<record id="public_holidays_list_view" model="ir.ui.view">
             <field name="name">holidays.holidays.tree.view</field>
             <field name="model">holidays.holidays</field>
             <field name="arch" type="xml">
                    <tree string="Public Holidays" editable="bottom">
                          <field name="name"/>
                          <field name="date"/>
                          <field name="percentage"/>
                          <field name="year" invisible="1"/>
                    </tree>
             </field>
     </record>

     <record id="public_holidays_search_view" model="ir.ui.view">
             <field name="name">holidays.holidays.search.view</field>
             <field name="model">holidays.holidays</field>
             <field name="arch" type="xml">
                    <search string="Public Holidays">
                            <group expand="0" string="Group By...">
                                   <filter name="group_by_year" string="Year" icon="terp-project" context="{'group_by':'year'}"/>
                            </group>
                    </search>
             </field>
     </record>

     <record id="open_view_public_holidays" model="ir.actions.act_window">
        <field name="name">Public Holidays</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">holidays.holidays</field>
        <field name="context">{'search_default_group_by_year': 1}</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree</field>
        <field name="view_id" eval="public_holidays_list_view"/>
        <field name="search_view_id" ref="public_holidays_search_view"/>
    </record>

The records are grouped, but not displayed, even if I expand the groups.
What is happening?
Further: I'd like the standard create button to still work while in search view.

Please help.

Imagine profil
Abandonează
Cel mai bun răspuns

Hi,

You must make sure year column has sufficiet value for it. You should follow existing core modules for the example.

We've added groupby expand feature on Odoo Apps.

https://www.odoo.com/apps/modules/8.0/web_groupby_expand/

Hope this helps.

Thanks.

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
mar. 15
7859
0
mar. 15
3139
2
dec. 23
1601
1
aug. 19
9104
0
mar. 15
4881