[FIX] stock: improve speed of product's stock quantity/value calculation
[odoo/odoo.git] / addons / stock / product_view.xml
index c1fc739..24da97c 100644 (file)
             <field name="inherit_id" ref="product.product_normal_form_view"/>
             <field name="arch" type="xml">
                 <field name="standard_price" position="replace">
-                    <group col="4" colspan="2">
-                        <field name="standard_price" readonly="True"/>
-                        <button name="%(action_view_change_standard_price)d" string="Change Price" type="action" icon="gtk-execute"/>
+                    <label string="Cost Price:" align="1.0"/>
+                    <group col="2" colspan="1">
+                        <field name="standard_price" attrs="{'readonly':[('cost_method','=','average')]}" nolabel="1"/>
+                        <button name="%(action_view_change_standard_price)d" string="Update"
+                            type="action" icon="gtk-execute" attrs="{'invisible':[('cost_method','&lt;&gt;','average')]}"/>
                     </group>
                 </field>
             </field>
             <field name="inherit_id" ref="product.product_normal_form_view"/>
             <field name="priority">26</field>
             <field name="arch" type="xml">
-                     <xpath expr="/form/notebook/page/group[@name='properties']" position="before"> 
-                               <group  groups="base.group_extended">
-                               <separator string="Stock Input/Output Account" colspan="2"/>
-                                <newline/>
-                               <field name="valuation"/>
-                           <field name="property_stock_account_output"  attrs="{'readonly':[('valuation', '!=', 'real_time')]}" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" groups="base.group_extended"/>
-                           <field name="property_stock_account_input"  attrs="{'readonly':[('valuation', '!=', 'real_time')]}"  domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" groups="base.group_extended"/>
+                <xpath expr="/form/notebook/page/group[@name='properties']" position="before">
+                    <group groups="base.group_extended">
+                        <separator string="Inventory Valuation" colspan="4"/>
+                        <group colspan="2" col="2">
+                            <field name="valuation"/>
+                        </group>
+                        <group colspan="2" col="2">
+                            <field name="property_stock_account_input" attrs="{'readonly':[('valuation', '!=', 'real_time')]}"
+                                domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" groups="base.group_extended"/>
+                            <field name="property_stock_account_output" attrs="{'readonly':[('valuation', '!=', 'real_time')]}"
+                                domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" groups="base.group_extended"/>
+                        </group>
                     </group>
                     <newline/>
-                    </xpath>
+                </xpath>
             </field>
         </record>
 
             <field name="inherit_id" ref="product.product_normal_form_view"/>
             <field name="arch" type="xml">
                 <group name="status" position="after">
-                    <group colspan="2" col="2">
+                    <group colspan="2" col="3">
                         <separator string="Stocks" colspan="4"/>
                         <field name="qty_available"/>
+                        <button name="%(action_view_change_product_quantity)d" string="Update" attrs="{'invisible': [('type', '=', 'service')]}"
+                            type="action" icon="gtk-execute" groups = "stock.group_stock_manager,stock.group_stock_user"/>
+                        <newline/>
                         <field name="virtual_available"/>
                     </group>
                     <group colspan="2" col="2" name="lot" groups="base.group_extended">