[IMP] SO form clean the mess
authorYannick Tivisse <yti@odoo.com>
Wed, 3 Dec 2014 10:15:19 +0000 (11:15 +0100)
committerRichard Mathot <rim@odoo.com>
Wed, 10 Dec 2014 13:37:27 +0000 (14:37 +0100)
addons/sale/sale_view.xml
addons/sale_crm/sale_crm_view.xml
addons/sale_journal/sale_journal_view.xml
addons/sale_order_dates/sale_order_dates_view.xml
addons/sale_stock/sale_stock_view.xml

index 45d13bc..f48e56c 100644 (file)
                         </page>
                         <page string="Other Information" groups="base.group_user">
                             <group>
-                                <group name="sales_person" groups="base.group_user">
+                                <group string="Sales Information" name="sales_person" groups="base.group_user">
                                     <field name="user_id" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'account.group_account_invoice', 'base.group_sale_salesman_all_leads']}"/>
                                     <field name="team_id" options="{'no_create': True}" groups="base.group_multi_salesteams"/>
-                                    <field groups="base.group_no_one" name="origin"/>
                                     <field name="client_order_ref"/>
+                                    <field name="invoice_exists" invisible="1"/>
+                                    <field name="company_id" widget="selection" groups="base.group_multi_company"/>
                                 </group>
-                                <group name="sale_pay">
+                                <group name="sale_pay" string="Invoicing">
                                     <field name="fiscal_position" options="{'no_create': True}"
                                         on_change="onchange_fiscal_position(fiscal_position, order_line, context)"/>
-                                    <field name="company_id" widget="selection" groups="base.group_multi_company"/>
                                 </group>
-                                <group>
-                                    <field name="invoiced"/>
-                                    <field name="invoice_exists" invisible="1"/>
+                                <group string="Reporting" name="technical" groups="base.group_no_one">
+                                    <field groups="base.group_no_one" name="origin"/>
+                                    <field groups="base.group_no_one" name="invoiced"/>
                                 </group>
                             </group>
                         </page>
index f17a5f7..ddba096 100644 (file)
                 <field name="user_id" position="after">
                     <field name="tag_ids" widget="many2many_tags"/>
                 </field>
-                <field name="client_order_ref" position="after">
-                    <field name="campaign_id" />
-                    <field name="medium_id" />
-                    <field name="source_id" />
-                </field>
-                <field name="origin" position="after">
-                    <field name="opportunity_id"/>
-                </field>
+                <xpath expr="//group[@name='technical']" position="inside">
+                    <field name="campaign_id" groups="base.group_no_one" />
+                    <field name="medium_id" groups="base.group_no_one"/>
+                    <field name="source_id" groups="base.group_no_one"/>
+                    <field name="opportunity_id" help="Log in the chatter from what opportunity the order comes" groups="base.group_no_one"/>
+                </xpath>
             </field>
         </record>
         <record id="base.res_partner_address_type" model="ir.ui.view">
index fdebe49..03c8c57 100644 (file)
@@ -51,9 +51,9 @@
             <field name="model">sale.order</field>
             <field name="inherit_id" ref="sale.view_order_form" />
             <field name="arch" type="xml">
-                <field name="origin" position="after">
+                <xpath expr="//group[@name='sale_pay']" position="inside">
                     <field name="invoice_type_id"/>
-                </field>
+                </xpath>
             </field>
         </record>
 
index 5027fef..7b975bf 100644 (file)
@@ -5,15 +5,12 @@
         <record id="view_sale_orderfor" model="ir.ui.view">
             <field name="name">sale.order.form.inherit5</field>
             <field name="model">sale.order</field>
-            <field name="inherit_id" ref="sale.view_order_form"/>
+            <field name="inherit_id" ref="sale_stock.view_order_form_inherit"/>
             <field name="arch" type="xml">
-                <group name="sale_pay" position="after">
-                    <group colspan="2" col="2" >
-                        <separator string="Dates" colspan="2"/>
-                        <field name="requested_date" on_change="onchange_requested_date(requested_date, commitment_date)"/>
-                        <field name="commitment_date"/>
-                        <field name="effective_date"/>
-                    </group>
+                <group name="sale_shipping" position="inside">
+                    <field name="requested_date" on_change="onchange_requested_date(requested_date, commitment_date)"/>
+                    <field name="commitment_date"/>
+                    <field name="effective_date"/>
                 </group>
             </field>
         </record>
index 4088395..e3f0ab3 100644 (file)
                     <field name="company_id" position="replace">
                         <field name="company_id" readonly="True"/>
                     </field>
-                    <field name="client_order_ref" position="after">
-                         <field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)" options="{'no_create': True}" groups="stock.group_locations"/>
-                    </field>
-                   <xpath expr="//field[@name='order_line']/form//field[@name='product_id']" position="attributes">
-                       <attribute name="on_change">product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,False,product_uos_qty,False,name,parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position, False, parent.warehouse_id, context)</attribute>
+                    <xpath expr="//group[@name='sales_person']" position="before">
+                        <group string="Shipping Information" name="sale_shipping">
+                            <field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)" options="{'no_create': True}" groups="stock.group_locations"/>
+                            <field name="incoterm" widget="selection" groups="base.group_user"/>
+                            <field name="picking_policy" required="True"/>
+                        </group>
+                    </xpath>
+                    <xpath expr="//field[@name='order_line']/tree//field[@name='product_id']" position="replace">
+                       <field name="product_id"
+                       context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}"
+                       groups="base.group_user" 
+                       on_change="product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,False,product_uos_qty,False,name,parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position, False, parent.warehouse_id, context)"/>
                    </xpath>
                    <xpath expr="//field[@name='order_line']/tree//field[@name='product_id']" position="attributes">
                        <attribute name="on_change">product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,False,product_uos_qty,False,name,parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position, False, parent.warehouse_id, context)</attribute>
                    <xpath expr="//field[@name='order_line']/tree//field[@name='product_uom_qty']" position="attributes">
                        <attribute name="on_change">product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,False,name,parent.partner_id, False, False, parent.date_order, product_packaging, parent.fiscal_position, True, parent.warehouse_id, context)</attribute>
                    </xpath>
-                   <xpath expr="//field[@name='order_line']/form//field[@name='product_uos_qty']" position="attributes">
-                       <attribute name="context">{'partner_id':parent.partner_id, 'quantity':product_uos_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}</attribute>
-                        <attribute name="on_change">product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, False, False, parent.date_order, product_packaging, parent.fiscal_position, True, parent.warehouse_id, context)</attribute>
+                   <xpath expr="//group[@name='technical']" position="inside">
+                       <field name="shipped" groups="base.group_no_one"/>
+                       <field name="invoice_exists" invisible="1" groups="base.group_no_one"/>
                    </xpath>
-                   <xpath expr="//field[@name='order_line']/form//field[@name='product_uom_qty']" position="attributes">
-                       <attribute name="on_change">product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,False,name,parent.partner_id, False, False, parent.date_order, product_packaging, parent.fiscal_position, True, parent.warehouse_id, context)</attribute>
-                   </xpath>
-                   <field name='invoiced' position="after">
-                       <field name="shipped"/>
-                       <field name="invoice_exists" invisible="1"/>
-                   </field>
                    <xpath expr="//page[@string='Order Lines']/field[@name='order_line']/form[@string='Sales Order Lines']/group/group/field[@name='tax_id']" position="after">
                        <label for="delay"/>
                        <div>
                    <xpath expr="//page[@string='Order Lines']/field[@name='order_line']/tree[@string='Sales Order Lines']/field[@name='th_weight']" position="after">
                        <field name="product_packaging" invisible="1"/>
                    </xpath>
-                   <xpath expr="//group[@name='sales_person']" position="before">
-                        <group name="logistics">
-                            <field name="incoterm" widget="selection" groups="base.group_user"/>
-                            <field name="picking_policy" required="True"/>
+                   <xpath expr="//group[@name='sale_pay']" position="inside">
                             <field name="order_policy"/>
-                        </group>
-                   </xpath>
+                   </xpath>                            
                    <xpath expr="//field[@name='order_line']/form/group/group/field[@name='price_unit']" position="before">
                         <field name="route_id" groups="sale_stock.group_route_so_lines"/>
                    </xpath>