[FIX]: usablity review
[odoo/odoo.git] / addons / sale / sale_view.xml
index c057920..6a9afb9 100644 (file)
-<?xml version="1.0"?>
-<terp>
-<data>
-       <menuitem name="Sales Management" icon="terp-sale" id="menu_sale_root"/>
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+<!--        <menuitem icon="terp-sale" id="menu_sale_root" name="Sales Management"-->
+<!--            groups="group_sale_user"/>-->
+        <menuitem id="base.menu_sales" name="Sales" parent="base.menu_base_partner" sequence="1"/>
 
-       <record model="ir.ui.view" id="view_shop_form">
-               <field name="name">sale.shop</field>
-               <field name="model">sale.shop</field>
-               <field name="type">form</field>
-               <field name="arch" type="xml">
-                       <form string="Sale Shop">
-                               <field name="name" select="1"/>
-                               <field name="warehouse_id" select="1" required="1"/>
-                               <separator string="Accounting" colspan="4"/>
-                               <field name="payment_default_id"/>
-                               <field name="pricelist_id" domain="[('type','=','sale')]" select="1"/>
-                               <field name="project_id" select="1"/>
-                               <separator string="Payment accounts" colspan="4"/>
-                               <field name="payment_account_id" colspan="4" nolabel="1"/>
-                       </form>
-               </field>
-       </record>
-       <record model="ir.ui.view" id="view_shop_tree">
-               <field name="name">sale.shop</field>
-               <field name="model">sale.shop</field>
-               <field name="type">tree</field>
-               <field name="arch" type="xml">
-                       <tree string="Sale Shop">
-                               <field name="name"/>
-                               <field name="pricelist_id"/>
-                               <field name="project_id"/>
-                               <field name="warehouse_id"/>
-                       </tree>
-               </field>
-       </record>
+        <menuitem id="base.menu_product" name="Products" parent="base.menu_base_partner" sequence="4"/>
+        <menuitem action="product.product_normal_action" id="product.menu_products" parent="base.menu_product" sequence="1"/>
 
-       <record model="ir.actions.act_window" id="action_shop_form">
-               <field name="type">ir.actions.act_window</field>
-               <field name="res_model">sale.shop</field>
-               <field name="view_type">form</field>
-               <field name="view_id" ref="view_shop_tree"/>
-       </record>
-       <menuitem name="Sales Management/Configuration" groups="base.group_admin"
-               sequence="1"/>
-       <menuitem name="Sales Management/Configuration/Shop" id="menu_action_shop_form" action="action_shop_form"/>
+        <record id="view_shop_form" model="ir.ui.view">
+            <field name="name">sale.shop</field>
+            <field name="model">sale.shop</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <form string="Sale Shop">
+                    <field name="name" select="1"/>
+                    <field name="warehouse_id" required="1" select="1" widget="selection"/>
+                    <separator colspan="4" string="Accounting"/>
+                    <field name="payment_default_id"/>
+                    <field domain="[('type','=','sale')]" name="pricelist_id" select="1"/>
+                    <field name="project_id" select="1"/>
+                </form>
+            </field>
+        </record>
+        <record id="view_shop_tree" model="ir.ui.view">
+            <field name="name">sale.shop</field>
+            <field name="model">sale.shop</field>
+            <field name="type">tree</field>
+            <field name="arch" type="xml">
+                <tree string="Sale Shop">
+                    <field name="name"/>
+                    <field name="pricelist_id"/>
+                    <field name="project_id"/>
+                    <field name="warehouse_id"/>
+                </tree>
+            </field>
+        </record>
 
-       <record model="ir.ui.view" id="view_order_tree">
-               <field name="name">sale.order.tree</field>
-               <field name="model">sale.order</field>
-               <field name="type">tree</field>
-               <field name="arch" type="xml">
-                       <tree string="Sales orders">
-                               <field name="date_order"/>
-                               <field name="name"/>
-                               <field name="partner_id"/>
-                               <field name="partner_shipping_id"/>
-                               <field name="shipped"/>
-                               <field name="invoiced"/>
-                               <field name="amount_untaxed"/>
-                               <field name="state"/>
-                       </tree>
-               </field>
-       </record>
+        <record id="action_shop_form" model="ir.actions.act_window">
+            <field name="name">Shop</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">sale.shop</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree,form</field>
+            <field name="view_id" ref="view_shop_tree"/>
+        </record>
+        <menuitem action="action_shop_form" id="menu_action_shop_form" parent="base.menu_base_config" sequence="70"/>
 
-       <record model="ir.ui.view" id="view_order_form">
-               <field name="name">sale.order.form</field>
-               <field name="model">sale.order</field>
-               <field name="type">form</field>
-               <field name="arch" type="xml">
-                       <form string="Sales order">
-                               <notebook>
-                                       <page string="Sale Order">
-                                               <field name="name" select="1"/>
-                                               <group colspan="2" col="4">
-                                                       <field name="shipped" select="2"/>
-                                                       <field name="invoiced" select="2"/>
-                                               </group>
-                                               <newline/>
-                                               <field name="date_order" select="1"/>
-                                               <field name="shop_id" select="2" on_change="onchange_shop_id(shop_id)"/>
-                                               <field name="partner_id" select="1" on_change="onchange_partner_id(partner_id)" required="1"/>
-                                               <field name="partner_order_id" domain="[('partner_id','=',partner_id)]"/>
-                                               <field name="partner_invoice_id" domain="[('partner_id','=',partner_id)]"/>
-                                               <field name="partner_shipping_id" domain="[('partner_id','=',partner_id)]"/>
-                                               <field name="pricelist_id"  domain="[('type','=','sale')]"/>
-                                               <field name="project_id" select="2"/>
-                                               <newline/>
-                                               <field name="order_line" widget="one2many_list" colspan="4" nolabel="1" mode="tree,graph">
-                                                       <form string="Sale Order Lines">
-                                                               <notebook>
-                                                                       <page string="Order Line">
-                                                                               <separator string="Automatic Declaration"
-                                                                                       colspan="4"/>
-                                                                               <field name="product_uom_qty"
-                                                                                       on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order)"
-                                                                                       context="partner_id=parent.partner_id,quantity=product_uom_qty,pricelist=parent.pricelist_id,shop=parent.shop_id,uom=product_uom"
-                                                                                       select="1"/>
-                                                                               <field name="product_uom"
-                                                                                       on_change="product_uom_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order)"
-                                                                                       />
-                                                                               <field name="product_id"
-                                                                                       on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], True, parent.date_order)"
-                                                                                       context="partner_id=parent.partner_id,quantity=product_uom_qty,pricelist=parent.pricelist_id,shop=parent.shop_id,uom=product_uom"
-                                                                                       colspan="4" select="1"/>
-                                                                               <separator string="Manual Description"
-                                                                                       colspan="4"/>
-                                                                               <field name="name" colspan="4" select="2"/>
-                                                                               <field name="price_unit" select="2"/>
-                                                                               <field name="discount"/>
-                                                                               <field name="type"/>
-                                                                               <field name="delay" select="2"/>
-                                                                               <newline/>
-                                                                               <field name="tax_id" colspan="4"/>
-                                                                               <separator string="States" colspan="4"/>
-                                                                               <field name="state" select="2"/>
-                                                                               <field name="invoiced" select="2"/>
-                                                                       </page>
-                                                                       <page string="Extra Info">
-                                                                               <field name="product_uos_qty" on_change="uos_change(product_uos, product_uos_qty, product_id)"/>
-                                                                               <field name="product_uos"  />
-                                                                               <field name="product_packaging" />
-                                                                               <field name="address_allotment_id" select="2"/>
-                                                                               <separator string="Properties" colspan="4"/>
-                                                                               <field name="property_ids" colspan="4" nolabel="1"/>
-                                                                       </page>
-                                                                       <page string="Notes">
-                                                                               <field name="notes" colspan="4" nolabel="1"/>
-                                                                       </page>
-                                                                       <page string="History">
-                                                                               <separator string="Invoice Lines" colspan="4"/>
-                                                                               <field name="invoice_lines" colspan="4" nolabel="1"/>
-                                                                               <separator string="Inventory Moves" colspan="4"/>
-                                                                               <field name="move_ids" colspan="4" nolabel="1"/>
-                                                                       </page>
-                                                               </notebook>
-                                                       </form>
-                                                       <tree string="Sales order lines">
-                                                               <field name="name" colspan="4"/>
-                                                               <field name="product_id"/>
-                                                               <field name="product_uom_qty" string="Qty"/>
-                                                               <field name="product_uom" string="UoM"/>
-                                                               <field name="discount"/>
-                                                               <field name="price_unit"/>
-                                                               <field name="price_net"/>
-                                                               <field name="price_subtotal"/>
-                                                       </tree>
-                                               </field>
-                                               <newline/>
-                                               <group colspan="4" col="7">
-                                                       <field name="amount_untaxed" sum="Untaxed amount"/>
-                                                       <field name="amount_tax"/>
-                                                       <field name="amount_total" sum="Total amount"/>
-                                                       <button name="button_dummy" string="Compute" states="draft" type="object"/>
-                                               </group>
-                                               <group colspan="4" col="13">
-                                                       <field name="state" select="2"/>
-                                                       <button name="order_confirm" string="Confirm Order" states="draft"/>
-                                                       <button name="invoice_recreate" string="Recreate Invoice" states="invoice_except"/>
-                                                       <button name="invoice_corrected" string="Invoice Corrected" states="invoice_except"/>
-                                                       <button name="ship_recreate" string="Recreate Procurement" states="shipping_except"/>
-                                                       <button name="ship_corrected" string="Procurement Corrected" states="shipping_except"/>
-                                                       <button name="manual_invoice" states="manual" string="Create Invoice"/>
-                                                       <button name="ship_cancel" string="Cancel Order" states="shipping_except"/>
-                                                       <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
-                                                       <button name="action_cancel" string="Cancel Order" states="manual,progress" type="object"/>
-                                                       <button name="cancel" string="Cancel Order" states="draft"/>
-                                                       <button name="invoice_cancel" string="Cancel Order" states="invoice_except"/>
-                                               </group>
-                                       </page>
-                                       <page string="Other data">
-                                               <field name="incoterm"/>
-                                               <field name="picking_policy" required="True"/>
-                                               <field name="user_id"/>
-                                               <field name="order_policy" />
-                                               <field name="origin"/>
-                                               <field name="invoice_quantity"/>
-                                               <field name="client_order_ref" />
-                                               <separator string="Notes" colspan="4"/>
-                                               <field name="note" colspan="4" nolabel="1"/>
-                                       </page>
-                                       <page string="History">
-                                               <separator string="Related invoices" colspan="4"/>
-                                               <field name="invoice_ids" colspan="4" nolabel="1"/>
-                                               <separator string="Related packings" colspan="4"/>
-                                               <field name="picking_ids" colspan="4" nolabel="1"/>
-                                       </page>
-                               </notebook>
-                       </form>
-               </field>
-       </record>
-       <record model="ir.actions.act_window" id="action_order_form">
-               <field name="type">ir.actions.act_window</field>
-               <field name="res_model">sale.order</field>
-               <field name="view_type">form</field>
-               <field name="view_id" ref="view_order_form"/>
-       </record>
-       <menuitem name="Sales Management/Sales Order" action="action_order_form" id="menu_sale_order"/>
+        <record id="view_sale_order_calendar" model="ir.ui.view">
+            <field name="name">sale.order.calendar</field>
+            <field name="model">sale.order</field>
+            <field name="type">calendar</field>
+            <field name="arch" type="xml">
+                <calendar string="Sales orders" color="state" date_start="date_order">
+                    <field name="partner_id"/>
+                    <field name="amount_total"/>
+                </calendar>
+            </field>
+        </record>
+        <record model="ir.ui.view" id="view_sale_order_graph">
+            <field name="name">sale.order.graph</field>
+            <field name="model">sale.order</field>
+            <field name="type">graph</field>
+            <field name="arch" type="xml">
+                <graph string="Sales orders" type="bar">
+                    <field name="partner_id"/>
+                    <field name="amount_total" operator="+"/>
+                </graph>
+            </field>
+        </record>
 
-       <record model="ir.actions.act_window" id="action_order_tree">
-               <field name="name">My Sales Order</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,form</field>
-               <field name="domain">[('user_id','=',uid)]</field>
-       </record>
-       <menuitem name="Sales Management/Sales Order/" id="menu_action_order_tree" action="action_order_tree"/>
+        <record id="view_order_tree" model="ir.ui.view">
+            <field name="name">sale.order.tree</field>
+            <field name="model">sale.order</field>
+            <field name="type">tree</field>
+            <field name="arch" type="xml">
+                <tree string="Sales orders">
+                    <field name="date_order" string="Order date"/>
+                    <field name="name" string="Reference"/>
+                    <field name="partner_id"/>
+                    <field name="partner_shipping_id"/>
+                    <field name="picked_rate" widget="progressbar"/>
+                    <field name="invoiced_rate" widget="progressbar"/>
+                    <field name="amount_untaxed" sum="Total Untaxed amount"/>
+                    <field name="amount_total" sum="Total amount"/>
+                    <field name="user_id"/>
+                    <field name="state"/>
+                </tree>
+            </field>
+        </record>
 
+        <record id="view_order_form" model="ir.ui.view">
+            <field name="name">sale.order.form</field>
+            <field name="model">sale.order</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <form string="Sales order">
+                    <group col="6" colspan="4">
+                        <field name="name" select="1"/>
+                        <field name="client_order_ref" select="2"/>
+                        <field name="shipped" select="2"/>
+                        <field name="shop_id" on_change="onchange_shop_id(shop_id)" select="2" widget="selection"/>
+                        <field name="date_order" select="1" string="Order date" />
+                        <field name="invoiced" select="2"/>
+                    </group>
+                    <notebook colspan="4">
+                        <page string="Sale Order">
+                            <field name="partner_id" on_change="onchange_partner_id(partner_id)" required="1" select="1"/>
+                            <field domain="[('partner_id','=',partner_id)]" name="partner_order_id"/>
+                            <field domain="[('partner_id','=',partner_id)]" name="partner_invoice_id"/>
+                            <field domain="[('partner_id','=',partner_id)]" name="partner_shipping_id"/>
+                            <field domain="[('type','=','sale')]" name="pricelist_id"/>
+                            <field name="project_id" select="2" context="{'partner_id':partner_id, 'contact_id':partner_order_id, 'pricelist_id':pricelist_id, 'default_name':name}"/>
+                            <newline/>
+                            <field colspan="4" mode="tree,form,graph" name="order_line" nolabel="1" widget="one2many_list">
+                                <form string="Sale Order Lines">
+                                    <notebook>
+                                        <page string="Order Line">
+                                            <separator colspan="4" string="Automatic Declaration"/>
+                                            <field colspan="4"
+                                                context="partner_id=parent.partner_id,quantity=product_uom_qty,pricelist=parent.pricelist_id,shop=parent.shop_id,uom=product_uom"
+                                                name="product_id"
+                                                on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], True, parent.date_order, product_packaging, parent.fiscal_position)"
+                                                select="1"/>
+                                            <field
+                                                context="partner_id=parent.partner_id,quantity=product_uom_qty,pricelist=parent.pricelist_id,shop=parent.shop_id,uom=product_uom"
+                                                name="product_uom_qty"
+                                                on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order, product_packaging, parent.fiscal_position, True)"
+                                                select="1"/>
+                                            <field name="product_uom"
+                                                on_change="product_uom_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order)"/>
+                                            <field
+                                                name="product_packaging"
+                                                context="partner_id=parent.partner_id,quantity=product_uom_qty,pricelist=parent.pricelist_id,shop=parent.shop_id,uom=product_uom"
+                                                on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order, product_packaging, parent.fiscal_position)"
+                                                domain="[('product_id','=',product_id)]"
+                                                groups="base.group_extended"/>
 
-       <record model="ir.actions.act_window" id="action_order_tree_all">
-               <field name="name">All Sales Order</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,form</field>
-       </record>
-       <menuitem name="Sales Management/Sales Order/" id="menu_action_order_tree_all" action="action_order_tree_all"/>
+                                            <field name="company_id" groups="base.group_multi_company" widget="selection"/>
+                                            <separator colspan="4" string="Manual Description"/>
+                                            <field colspan="4" name="name" select="2"/>
+                                            <field name="price_unit" select="2"/>
+                                            <field name="discount"/>
+                                            <field name="type"/>
+                                            <field name="delay" select="2"/>
+                                            <newline/>
+                                            <field colspan="4" name="tax_id" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
+                                            <separator colspan="4" string="States"/>
+                                            <field name="state" select="2"/>
+                                            <group col="3" colspan="2">
+                                                <field name="invoiced" select="2"/>
+                                                <button colspan="1"
+                                                    name="%(action_view_sale_order_line_make_invoice)d"
+                                                    states="confirmed"
+                                                    string="Make Invoice"
+                                                    type="action"
+                                                    icon="gtk-print" />
+                                            </group>
+                                        </page>
+                                        <page groups="base.group_extended" string="Extra Info">
+                                            <field groups="product.group_uos" name="product_uos_qty" on_change="uos_change(product_uos, product_uos_qty, product_id)"/>
+                                            <field groups="product.group_uos" name="product_uos"/>
+                                            <field name="th_weight"/>
+                                            <field name="address_allotment_id" select="2"/>
+                                            <separator colspan="4" string="Properties"/>
+                                            <field colspan="4" name="property_ids" nolabel="1"/>
+                                        </page>
+                                        <page string="Notes">
+                                            <field colspan="4" name="notes" nolabel="1"/>
+                                        </page>
+                                        <page string="History" groups="base.group_extended">
+                                            <separator colspan="4" string="Invoice Lines"/>
+                                            <field colspan="4" name="invoice_lines" nolabel="1"/>
+                                            <separator colspan="4" string="Stock Moves"/>
+                                            <field colspan="4" name="move_ids" nolabel="1" widget="many2many"/>
+                                        </page>
+                                    </notebook>
+                                </form>
+                                <tree string="Sales order lines">
+                                    <field colspan="4" name="name"/>
+                                    <field name="product_uom_qty" string="Qty"/>
+                                    <field name="product_uom" string="UoM"/>
+                                    <field name="discount"/>
+                                    <field name="price_unit"/>
+                                    <field name="price_net"/>
+                                    <field name="price_subtotal"/>
+                                </tree>
+                            </field>
+                            <newline/>
+                            <group col="7" colspan="4">
+                                <field name="amount_untaxed" sum="Untaxed amount"/>
+                                <field name="amount_tax"/>
+                                <field name="amount_total" sum="Total amount"/>
+                                <button name="button_dummy" states="draft" string="Compute" type="object" icon="gtk-execute"/>
+                            </group>
+                            <group col="13" colspan="4">
+                                <field name="state" select="2"/>
+                                <button name="order_confirm" states="draft" string="Confirm Order" icon="gtk-apply"/>
+                                <button name="invoice_recreate" states="invoice_except" string="Recreate Invoice" icon="gtk-print"/>
+                                <button name="invoice_corrected" states="invoice_except" string="Invoice Corrected" icon="gtk-apply"/>
+                                <button name="ship_recreate" states="shipping_except" string="Recreate Requisition" icon="gtk-ok"/>
+                                <button name="ship_corrected" states="shipping_except" string="Requisition Corrected" icon="gtk-apply"/>
+                                <button name="manual_invoice" states="manual" string="Create Invoice" icon="gtk-print"/>
+                                <button name="ship_cancel" states="shipping_except" string="Cancel Order" icon="gtk-cancel"/>
+                                <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="gtk-convert"/>
+                                <button name="action_cancel" states="manual,progress" string="Cancel Order" type="object" icon="gtk-cancel"/>
+                                <button name="cancel" states="draft" string="Cancel Order" icon="gtk-cancel"/>
+                                <button name="invoice_cancel" states="invoice_except" string="Cancel Order" icon="gtk-cancel"/>
+                            </group>
+                        </page>
+                        <page string="Other data">
+                            <group colspan="2" col="2">
+                                <separator string="Logistic" colspan="2"/>
+                                <field groups="base.group_extended" name="incoterm"/>
+                                <field groups="base.group_extended" name="picking_policy" required="True"/>
+                                <field name="order_policy" on_change="shipping_policy_change(order_policy)"/>
+                                <field groups="base.group_extended" name="invoice_quantity" attrs="{'readonly':[('order_policy','=','prepaid'),('order_policy','=','picking')]}"/>
+                            </group>
+                            <group colspan="2" col="2">
+                                <separator string="References" colspan="2"/>
+                                <field name="user_id"/>
+                                <field groups="base.group_extended" name="origin"/>
+                            </group>
+                            <group colspan="2" col="2">
+                                <separator string="Conditions" colspan="2"/>
+                                <field name="payment_term" widget="selection"/>
+                                <field name="fiscal_position" groups="base.group_extended" widget="selection"/>
+                                <field name="company_id" groups="base.group_multi_company" widget="selection"/>
+                            </group>
+                            <group colspan="2" col="2">
+                                <separator string="Dates" colspan="2"/>
+                                <field name="create_date"/>
+                                <field name="date_confirm"/>
+                            </group>
+                            <separator colspan="4" string="Notes"/>
+                            <field colspan="4" name="note" nolabel="1"/>
+                        </page>
+                        <page string="History">
+                            <separator colspan="4" string="Related invoices"/>
+                            <field colspan="4" name="invoice_ids" nolabel="1"/>
+                            <field colspan="4" name="picking_ids" nolabel="1"/>
+                        </page>
+                    </notebook>
+                </form>
+            </field>
+        </record>
 
+        <record id="view_sales_order_filter" model="ir.ui.view">
+            <field name="name">sale.order.list.select</field>
+            <field name="model">sale.order</field>
+            <field name="type">search</field>
+            <field name="arch" type="xml">
+                <search string="Search Sales Order">
+                    <filter icon="terp-sale" string="Quotations" domain="[('state','=','draft')]"/>
+                    <filter icon="terp-sale" string="Running" domain="[('state','in',('manual','progress'))]"/>
+                    <filter icon="terp-sale" string="Sales To Invoice" domain="[('state','=','manual')]"/>
+                    <separator orientation="vertical"/>
+                    <field name="name" select="1"/>
+                    <field name="partner_id" select="1"/>
+                    <field name="user_id" select="1" widget="selection">
+                        <filter icon="terp-partner" domain="[('user_id','=',uid)]" help="My Sale Orders" default="1"/>
+                    </field>
+                    <field name="date_order" select="1" string="Order date" />
+                    <newline/>
+                    <group expand="1" string="Group By..." colspan="11" col="11">
+                        <filter string="Customer" icon="terp-sale" domain="[]" context="{'group_by':'partner_id'}"/>
+                        <filter string="State" icon="terp-sale" domain="[]" context="{'group_by':'state'}"/>
+                        <filter string="Order Date" icon="terp-sale" domain="[]" context="{'group_by':'date_order'}"/>
+                        <filter string="Salesman" icon="terp-sale" domain="[]" context="{'group_by':'user_id'}"/>
+                    </group>
+               </search>
+            </field>
+        </record>
 
-       <record model="ir.actions.act_window" id="action_order_tree2">
-               <field name="name">Sales in Exception</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,form</field>
-               <field name="domain">[('state','in',('shipping_except','invoice_except')]</field>
-       </record>
-       <menuitem name="Sales Management/Sales Order/All Sales Order/" id="menu_action_order_tree2" action="action_order_tree2"/>
+        <record id="action_order_form" model="ir.actions.act_window">
+            <field name="name">Sales Orders</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,form,calendar,graph</field>
+            <field name="search_view_id" ref="view_sales_order_filter"/>
+        </record>
+        <menuitem action="action_order_form" id="menu_sale_order" parent="base.menu_sales" sequence="3"/>
 
-       <record model="ir.actions.act_window" id="action_order_tree3">
-               <field name="name">Sales Order To Be Invoiced</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,form</field>
-               <field name="domain">[('state','=','manual')]</field>
-       </record>
-       <menuitem name="Sales Management/Sales Order/All Sales Order/" id="menu_action_order_tree3" action="action_order_tree3"/>
+        <record id="action_order_tree2" model="ir.actions.act_window">
+            <field name="name">Sales in Exception</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,form,calendar,graph</field>
+            <field name="domain">[('state','in',('shipping_except','invoice_except'))]</field>
+            <field name="filter" eval="True"/>
+            <field name="search_view_id" ref="view_sales_order_filter"/>
+        </record>
 
-       <record model="ir.actions.act_window" id="action_order_tree4">
-               <field name="name">Sales Order in Progress</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,form</field>
-               <field name="domain">[('state','in',('progress','waiting_date','manual'))]</field>
-       </record>
-       <menuitem 
-               name="Sales Management/Sales Order/All Sales Order/Sales in Progress" 
-               sequence="2"
-               id="menu_action_order_tree4" 
-               action="action_order_tree4"/>
+        <record id="action_order_tree4" model="ir.actions.act_window">
+            <field name="name">Sales Order in Progress</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,form,calendar,graph</field>
+            <field name="domain">[('state','in',('progress','waiting_date','manual'))]</field>
+            <field name="search_view_id" ref="view_sales_order_filter"/>
+        </record>
 
 
-       <record model="ir.actions.act_window" id="action_order_tree5">
-               <field name="name">All Quotations</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,form</field>
-               <field name="domain">[('state','=','draft')]</field>
-       </record>
-       <menuitem 
-               name="Sales Management/Sales Order/All Sales Order/All Quotations" 
-               id="menu_action_order_tree5" 
-               sequence="1"
-               action="action_order_tree5"/>
+        <record id="action_order_tree5" model="ir.actions.act_window">
+            <field name="name">All Quotations</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,form,calendar,graph</field>
+            <field name="domain">[('state','=','draft')]</field>
+            <field name="search_view_id" ref="view_sales_order_filter"/>
+        </record>
 
-       <record model="ir.actions.act_window" id="action_order_tree7">
-               <field name="name">My sales in shipping exception</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,form</field>
-               <field name="domain">[('state','in',('shipping_except','invoice_except')),('user_id','=',uid)]</field>
-       </record>
-       <menuitem name="Sales Management/Sales Order/My Sales Order/My Sales in Exception" id="menu_action_order_tree7" action="action_order_tree7"/>
+        <record id="action_order_tree" model="ir.actions.act_window">
+            <field name="name">Old Quotations</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,form,calendar,graph</field>
+            <field name="domain">[('state','=','draft'),('date_order','&lt;',time.strftime('%Y-%m-%d %H:%M:%S'))]</field>
+            <field name="filter" eval="True"/>
+            <field name="search_view_id" ref="view_sales_order_filter"/>
+        </record>
 
-       <record model="ir.actions.act_window" id="action_order_tree8">
-               <field name="name">My sales order waiting Invoice</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,form</field>
-               <field name="domain">[('state','=','manual'),('user_id','=',uid)]</field>
-       </record>
-       <menuitem name="Sales Management/Sales Order/My Sales Order/My Sales to be Invoiced" id="menu_action_order_tree8" action="action_order_tree8"/>
+        <record id="view_order_line_graph" model="ir.ui.view">
+            <field name="name">sale.order.line.graph</field>
+            <field name="model">sale.order.line</field>
+            <field name="type">graph</field>
+            <field name="arch" type="xml">
+                <graph string="Sales order lines">
+                    <field name="product_id"/>
+                    <field name="price_subtotal" operator="+"/>
+                </graph>
+            </field>
+        </record>
 
-       <record model="ir.actions.act_window" id="action_order_tree9">
-               <field name="name">My sales order in progress</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,form</field>
-               <field name="domain">[('state','in',('progress','waiting_date','manual')),('user_id','=',uid)]</field>
-       </record>
-       <menuitem 
-               name="Sales Management/Sales Order/My Sales Order/My Sales in Progress" 
-               sequence="2"
-               id="menu_action_order_tree9" 
-               action="action_order_tree9"/>
+        <record id="view_order_line_tree" model="ir.ui.view">
+            <field name="name">sale.order.line.tree</field>
+            <field name="model">sale.order.line</field>
+            <field name="type">tree</field>
+            <field name="arch" type="xml">
+                <tree string="Sales order lines">
+                    <field name="order_id"/>
+                    <field name="order_partner_id"/>
+                    <field name="product_id"/>
+                    <field name="product_uom_qty" string="Qty"/>
+                    <field name="product_uom" string="UoM"/>
+                    <field name="discount"/>
+                    <field name="price_unit"/>
+                    <field name="price_net"/>
+                    <field name="price_subtotal"/>
+                    <field name="th_weight"/>
+                    <field name="state"/>
+                </tree>
+            </field>
+        </record>
+        <record id="view_order_line_form2" model="ir.ui.view">
+            <field name="name">sale.order.line.form2</field>
+            <field name="model">sale.order.line</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <form string="Sales Order Lines">
+                    <notebook>
+                        <page string="Order Lines">
+                            <separator colspan="4" string="Automatic Declaration"/>
+                            <field name="order_id" select="1"/>
+                            <field name="order_partner_id" readonly="1" select="1" invisible="1"/>
+                            <field name="product_uom_qty" readonly="1" select="2"/>
+                            <field name="product_uom"/>
+                            <field name="product_id" readonly="1" select="1"/>
+                            <field name="invoiced" select="2"/>
+                            <field name="company_id" groups="base.group_multi_company" widget="selection"/>
+                            <separator colspan="4" string="Manual Designation"/>
+                            <field colspan="4" name="name" select="2"/>
+                            <field name="price_unit" select="2"/>
+                            <field name="discount"/>
+                            <field name="type"/>
+                            <field name="delay" select="2"/>
+                            <field name="price_subtotal"/>
+                            <field name="th_weight"/>
+                            <field colspan="4" name="tax_id" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
+                            <separator colspan="4" string="States"/>
+                            <field name="state" select="2"/>
+                            <group col="2" colspan="2">
+                                <button name="button_done"
+                                       states="confirmed,exception"
+                                       string="Done" type="object"
+                                       icon="gtk-jump-to" />
+                                <button name="button_cancel"
+                                       states="confirmed,exception"
+                                       string="Cancel" type="object"
+                                       icon="gtk-cancel" />
+                            </group>
+                        </page>
+                        <page string="Properties">
+                            <field name="property_ids" nolabel="1"/>
+                        </page>
+                        <page string="Notes">
+                            <field colspan="4" name="notes" nolabel="1"/>
+                        </page>
+                        <page string="Invoice Lines">
+                            <field colspan="4" name="invoice_lines" nolabel="1"/>
+                        </page>
+                    </notebook>
+                </form>
+            </field>
+        </record>
 
+        <record id="view_sales_order_line_filter" model="ir.ui.view">
+            <field name="name">sale.order.line.select</field>
+            <field name="model">sale.order.line</field>
+            <field name="type">search</field>
+            <field name="arch" type="xml">
+                <search string="Search Sales Order">
+                    <filter icon="terp-purchase" string="To Invoice" domain="[('invoiced','&lt;&gt;', 1),('state','=','done')]" separator="1"/>
+                    <separator orientation="vertical"/>
+                    <field name="order_id" select="1"/>
+                    <field name="order_partner_id" select="1"/>
+                    <field name="product_id" select="1"/>
+                    <field name="salesman_id" select="1" widget="selection">
+                        <filter icon="terp-sale" domain="[('salesman_id','=',uid)]" help="My Sale Order Lines"/>
+                        <filter icon="terp-sale" domain="[('salesman_id','child_of',[uid])]" help="My Departments Sale Order Lines"/>
+                    </field>
+                    <newline/>
+                    <group expand="context.get('report',False)" string="Group By..." colspan="9" col="8">
+                        <filter string="Product" icon="terp-sale"  default="1" domain="[]" context="{'group_by':'product_id'}"/>
+                        <filter string="Order" icon="terp-sale" domain="[]" context="{'group_by':'order_id'}"/>
+                        <filter string="State" icon="terp-sale" domain="[]" context="{'group_by':'state'}"/>
+                    </group>
+                </search>
+            </field>
+        </record>
 
-       <record model="ir.actions.act_window" id="action_order_tree10">
-               <field name="name">My Quotations</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,form</field>
-               <field name="domain">[('state','=','draft'),('user_id','=',uid)]</field>
-       </record>
-       <menuitem
-               name="Sales Management/Sales Order/My Sales Order/"
-               sequence="1"
-               id="menu_action_order_tree10" action="action_order_tree10"/>
+        <record id="view_sales_order_uninvoiced_line_filter" model="ir.ui.view">
+            <field name="name">sale.order.uninvoiced.line</field>
+            <field name="model">sale.order.line</field>
+            <field name="type">search</field>
+            <field name="arch" type="xml">
+                <search string="Search Uninvoiced Lines">
+                       <filter icon="terp-purchase" string="Shipped"
+                               domain="[('state','=','done')]"
+                               separator="1" />
+                       <filter icon="terp-purchase" string="Uninvoiced"
+                               domain="[('invoiced','&lt;&gt;', 1),('state','&lt;&gt;','draft'),('state','&lt;&gt;','cancel')]"  default="1"
+                               separator="1" />
+                       <separator orientation="vertical"/>
+                    <field name="order_id" select="1"/>
+                    <field name="product_id" select="1"/>
+                    <field name="order_partner_id" select="1"/>
+                    <field name="state" select="1"/>
+                    <newline />
+                    <group expand="1" string="Group By..." colspan="9" col="8">
+                        <filter string="Product" icon="terp-sale" domain="[]" context="{'group_by':'product_id'}"/>
+<!--                        <filter string="Customer" icon="terp-sale" domain="[]" context="{'group_by':'order_partner_id'}"/>-->
+                        <filter string="Order" icon="terp-sale" domain="[]" context="{'group_by':'order_id'}"/>
+                    </group>
+                </search>
+            </field>
+        </record>
 
+        <record id="action_order_line_tree2" model="ir.actions.act_window">
+            <field name="name">Uninvoiced Lines</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">sale.order.line</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree,form,graph</field>
+            <field name="search_view_id" ref="view_sales_order_uninvoiced_line_filter" />
+            <field name="filter" eval="True"/>
+        </record>
 
-       <record model="ir.ui.view" id="view_order_line_graph">
-               <field name="name">sale.order.line.graph</field>
-               <field name="model">sale.order.line</field>
-               <field name="type">graph</field>
-               <field name="arch" type="xml">
-                       <graph string="Sales order lines">
-                               <field name="product_id"/>
-                               <field name="price_unit" operator="+"/>
-                       </graph>
-               </field>
-       </record>
+        <record id="action_order_line_tree3" model="ir.actions.act_window">
+            <field name="name">Uninvoiced and Delivered Lines</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">sale.order.line</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree,form,graph</field>
+            <field name="domain">[('invoiced','&lt;&gt;', 1),('state','=','done')]</field>
+            <field name="filter" eval="True"/>
+        </record>
 
+        <act_window context="{'partner_id': active_id}" domain="[('partner_id', '=', active_id)]" id="act_res_partner_2_sale_order" name="Sales" res_model="sale.order" src_model="res.partner"/>
 
-       <record model="ir.ui.view" id="view_order_line_tree">
-               <field name="name">sale.order.line.tree</field>
-               <field name="model">sale.order.line</field>
-               <field name="type">tree</field>
-               <field name="arch" type="xml">
-                       <tree string="Sales order lines">
-                               <field name="order_id"/>
-                               <field name="name" colspan="4"/>
-                               <field name="product_id"/>
-                               <field name="product_uom_qty" string="Qty"/>
-                               <field name="product_uom" string="UoM"/>
-                               <field name="discount"/>
-                               <field name="price_unit"/>
-                               <field name="price_net"/>
-                               <field name="price_subtotal"/>
-                       </tree>
-               </field>
-       </record>
-       <record model="ir.ui.view" id="view_order_line_form2">
-               <field name="name">sale.order.line.form2</field>
-               <field name="model">sale.order.line</field>
-               <field name="type">form</field>
-               <field name="arch" type="xml">
-                       <form string="Sales order lines">
-                               <notebook>
-                                       <page string="Order Lines">
-                                               <separator string="Automatic Declaration" colspan="4"/>
-                                               <field name="order_id" select="1"/>
-                                               <field name="invoiced" select="2"/>
-                                               <field name="product_uom_qty" readonly="1" select="2"/>
-                                               <field name="product_uom" readonly="2"/>
-                                               <field name="product_id" readonly="1" select="1"/>
-       
-                                               <separator string="Manual Designation" colspan="4"/>
-                                               <field name="name" colspan="4" select="2"/>
-                                               <field name="price_unit" select="2"/>
-                                               <field name="discount"/>
-                                               <field name="type"/>
-                                               <field name="delay" select="2"/>
-                                               <field name="price_subtotal"/>
-                                               <field name="tax_id" colspan="4"/>
-                                               <separator string="States" colspan="4"/>
-                                               <field name="state" select="2"/>
-                                               <group colspan="2" col="2">
-                                                       <button string="Done" name="button_done" type="object" states="confirmed"/>
-                                               </group>
-                                       </page>
-                                       <page string="Properties">
-                                               <field name="property_ids" nolabel="1"/>
-                                       </page>
-                                       <page string="Notes">
-                                               <field name="notes" colspan="4" nolabel="1"/>
-                                       </page>
-                                       <page string="Invoice Lines">
-                                               <field name="invoice_lines" colspan="4" nolabel="1"/>
-                                       </page>
-                               </notebook>
-                       </form>
-               </field>
-       </record>
+        <act_window domain="[('product_id','=',active_id)]" id="action_order_line_product_tree" name="Product sales" res_model="sale.order.line" src_model="product.product"/>
 
+        <menuitem id="menu_invoiced" name="Invoicing" parent="base.menu_base_partner" sequence="6"/>
+        <menuitem action="action_order_line_tree2" id="menu_invoicing_sales_order_lines" parent="menu_invoiced" sequence="2"/>
+        <!-- configartion view -->
 
-       <record model="ir.actions.act_window" id="action_order_line_tree1">
-               <field name="type">ir.actions.act_window</field>
-               <field name="res_model">sale.order.line</field>
-               <field name="view_type">form</field>
-               <field name="view_id" ref="view_order_line_form2"/>
-       </record>
-       <menuitem name="Sales Management/Sales Order Lines" id="menu_action_order_line_tree1" action="action_order_line_tree1"/>
+        <record id="view_config_picking_policy" model="ir.ui.view">
+            <field name="name">Configure Picking Policy for Sale Order </field>
+            <field name="model">sale.config.picking_policy</field>
+            <field name="type">form</field>
+            <field name="inherit_id" ref="base.res_config_view_base"/>
+            <field name="arch" type="xml">
+              <data>
+                <form position="attributes">
+                  <attribute name="string">Sales Configuration</attribute>
+                </form>
+                <group string="res_config_contents" position="replace">
+                  <label colspan="4" align="0.0"
+                         string="Set the policies selected by default when creating a new sale order."/>
+                  <separator colspan="4"
+                       string="Configure Sale Order Logistic"/>
+                  <newline/>
+                  <field name="picking_policy"/>
+                  <newline/>
+                  <field name="order_policy"/>
+                  <newline/>
+                  <field name="step"/>
+                </group>
+                <xpath expr='//button[@name="action_skip"]' position='replace'/>
+              </data>
+            </field>
+        </record>
 
-       <record model="ir.actions.act_window" id="action_order_line_tree2">
-               <field name="name">Uninvoiced lines</field>
-               <field name="type">ir.actions.act_window</field>
-               <field name="res_model">sale.order.line</field>
-               <field name="view_type">form</field>
-               <field name="view_mode">tree,form</field>
-               <field name="domain">[('invoiced','&lt;&gt;', 1)]</field>
-       </record>
-       <menuitem name="Sales Management/Sales Order Lines/Uninvoiced Lines" id="menu_action_order_line_tree2" action="action_order_line_tree2"/>
+        <record id="action_config_picking_policy" model="ir.actions.act_window">
+            <field name="name">Configure Picking Policy for Sale Order</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">sale.config.picking_policy</field>
+            <field name="view_id" ref="view_config_picking_policy"/>
+            <field name="view_type">form</field>
+            <field name="view_mode">form</field>
+            <field name="target">new</field>
+        </record>
 
-       <record model="ir.actions.act_window" id="action_order_line_tree3">
-               <field name="name">Uninvoiced and Delivered Lines</field>
-               <field name="type">ir.actions.act_window</field>
-               <field name="res_model">sale.order.line</field>
-               <field name="view_type">form</field>
-               <field name="view_mode">tree,form</field>
-               <field name="domain">[('invoiced','&lt;&gt;', 1),('state','=','done')]</field>
-       </record>
-       <menuitem name="Sales Management/Sales Order Lines/Uninvoiced Lines/Uninvoiced &amp; Delivered Lines" id="menu_action_order_line_tree3" action="action_order_line_tree3"/>
+        <!-- register configuration wizard -->
+        <record id="config_wizard_step_sale_picking_policy" model="ir.actions.todo">
+            <field name="action_id" ref="action_config_picking_policy"/>
+        </record>
 
-       <act_window name="Sales"
-               domain="[('partner_id', '=', active_id)]"
-               context="{'partner_id': active_id}"
-               res_model="sale.order"
-               src_model="res.partner"
-               id="act_res_partner_2_sale_order"/>
-
-       <act_window name="Product sales"
-               id="action_order_line_product_tree"
-               res_model="sale.order.line"
-               src_model="product.product"
-               domain="[('product_id','=',active_id)]"/>
-
-
-</data>
-</terp>
+    </data>
+</openerp>