Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

search view not displays [Closed]

By
Anuradha
on 9/13/13, 6:40 AM 1,343 views

The Question has been closed

by
Sudhir Arya (SA)
on 09/19/2013 12:08:11
Hi,
I have a menu which displays a form with "display files" button. On clicking that it will go to "get_files" function in py and it will 
return a form with file name. I want to show search view also in this form.In xml i added search view ,but its not showing.
My code is

 def get_filenames(self, cr, uid, ids, context=None):
       // code for inserting file names in db
        return {
            'type'      :   'ir.actions.act_window',
            'name'      :   'File Details',
            'view_mode' :   'tree',
            'view_type' :   'tree',
            'res_model' :   'filedata',
            'context'   :   context,
        }

My xml is
 <record id="voipdata_form_view" model="ir.ui.view">
            <field name="name">File Details</field>
            <field name="model">filedata</field>
            <field name="priority" eval="1"/>
            <field name="type">form</field>
            <field name="arch" type="xml">
                 <form string="File Names">
                    <field name="name" string="Name"/>
                    <field name="time_created" string="Time Created"/>
                    <field name="size" string="Size"/>
                </form>
            </field>
        </record>
        <record id="voipdata_tree_view" model="ir.ui.view">
            <field name="name">File Details</field>
            <field name="model">filedata</field>
            <field name="priority" eval="2"/>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="File Names">
                    <field name="name" string="Name"/>
                    <field name="time_created" string="Time Created"/>
                    <field name="size" string="Size"/>
                </tree>
            </field>
        </record>
<record model="ir.actions.act_window" id="action_voipdata_form">
            <field name="name">File Details</field>
            <field name="res_model">filedata</field>
            <field name="view_type">form</field>
            <field name="view_mode">form,tree</field>
           <!-- <field name="view_id" ref="voipdata_tree_view"/> -->
        </record>
<record id="voip_filter" model="ir.ui.view">
            <field name="name">filedata.select</field>
            <field name="model">filedata</field>
            <field name="arch" type="xml">
                <search string="File Details">
                    <field name="name" string="Name"/>
                    <field name="time_created" string="Time Created"/>
                    <field name="size" string="Size"/>
                    <group expand="0" string="Group By...">
                        <filter string="Name" icon="terp-personal" domain="[]" context="{'group_by':'name'}"/>
                        <filter string="Time Created" icon="terp-personal" domain="[]" context="{'group_by':'time_created'}"/>
                        <filter string="Size" icon="terp-personal" domain="[]" context="{'group_by':'size'}"/>
                    </group>
                </search>
            </field>
        </record>
Any one please help!!
-1

Sudhir Arya (SA)

--Sudhir Arya (SA)--
10150
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow

LinkedIn

Blog

Stackoverflow

Sudhir Arya (SA)
On 9/14/13, 6:37 PM

Add views in view_mode which you want to display.

Ex: 'view_mode' : 'tree, search, form'.

I dont want search view . I want search option for my tree view

Anuradha
on 9/18/13, 8:18 AM
1
Pau Ubach
On 10/12/14, 10:35 PM

View Type must be form:

 

'view_type' : 'form'

not enough karma to set this as answer

Raffaele
on 10/21/15, 7:38 AM
0
Pau Ubach
On 10/12/14, 10:36 PM

View Type must be form:

'view_type' : 'form'

0
Pau Ubach
On 10/12/14, 10:35 PM

View Type must be form:

 

'view_type' : 'form'

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 9/13/13, 6:40 AM
Seen: 1343 times
Last updated: 3/16/15, 8:10 AM