This question has been flagged
1 Reply
3476 Views

I am making a search view in Openerp v7. I want to add the view to sales but I have customized module which added more fields to the sale.order model. The view should display all records of different statuses like draft quotations, sent for sale etc. In the Quotations only those with draft quotations are sent and are not displayed when the sale is confirmed. My search view does not show the sales when they are in draft quotation state.My search view and action is given below

<record model="ir.ui.view" id="view_sale_order_search">
        <field name="name">sale.order.tickets</field>
        <field name="model">sale.order</field>
            <field name="arch" type="xml">
                <search string="Search Sales">
                    <field name="name" string="Sales" filter_domain="[('name','like',self)]"/>
                    <separator/>
                    <filter  string="To Invoice" domain="[('state','=','manual')]" />
                    <filter  string="Done" domain="[('state','=','done')]" help="Sales Order done"/> 
                    <separator/>
                    <filter string="Group by Customer" domain="[]" context="{'group_by':'partner_id'}"/>
                    <filter string="Group by Username" domain="[]" context="{'group_by':'user_id'}"/>
                    <filter string="Group by Status" domain="[]" context="{'group_by':'state'}"/>
                    <filter string="Group by Date"  domain="[]" context="{'group_by':'date_order'}"/>
               </search>
            </field>
        </record>

        <record model="ir.actions.act_window" id="action_sale_order_search">
            <field name="name">action.sale.order.search</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">sale.order</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree</field>
            <field name="search_view_id" ref="view_sale_order_search"/>
        </record>

 

Avatar
Discard
Author Best Answer

Do you have a menu using the Window action? The out of the box menus for Quotations and Sales Orders have domains that show ONLY Quotations ( draft Sales Orders - [('state','in',('draft','sent','cancel'))] ) or Sales Orders ( confirmed Quotations - [('state','not in',('draft','sent','cancel'))] ).

Avatar
Discard