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

Implement a sale.order search view with all sales and quotations available?

By
Waheed Khan
on 5/29/14, 1:52 PM 951 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>

 

0
Waheed Khan
On 5/30/14, 2:47 AM

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'))] ).

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

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

Question tools

2 follower(s)

Stats

Asked: 5/29/14, 1:52 PM
Seen: 951 times
Last updated: 3/16/15, 8:10 AM