[FIX]stock: added a group , class on button, improve a menu tip,label name,added...
authorMayur Maheshwari (OpenERP) <mma@tinyerp.com>
Mon, 11 Jun 2012 09:59:14 +0000 (15:29 +0530)
committerMayur Maheshwari (OpenERP) <mma@tinyerp.com>
Mon, 11 Jun 2012 09:59:14 +0000 (15:29 +0530)
bzr revid: mma@tinyerp.com-20120611095914-631eo6yw8bz9aknx

addons/mrp/mrp.py
addons/mrp/mrp_view.xml
addons/procurement/procurement.py
addons/procurement/procurement_view.xml
addons/product/product_view.xml
addons/stock/product_view.xml

index 3214cad..8c2069f 100644 (file)
@@ -454,7 +454,7 @@ class mrp_production(osv.osv):
         'priority': fields.selection([('0','Not urgent'),('1','Normal'),('2','Urgent'),('3','Very Urgent')], 'Priority', select=True),
 
         'product_id': fields.many2one('product.product', 'Product', required=True, readonly=True, states={'draft':[('readonly',False)]}),
-        'product_qty': fields.float('Product Qty', digits_compute=dp.get_precision('Product Unit of Measure'), required=True, states={'draft':[('readonly',False)]}, readonly=True),
+        'product_qty': fields.float('Product Quantity', digits_compute=dp.get_precision('Product Unit of Measure'), required=True, states={'draft':[('readonly',False)]}, readonly=True),
         'product_uom': fields.many2one('product.uom', 'Product Unit of Measure', required=True, states={'draft':[('readonly',False)]}, readonly=True),
         'product_uos_qty': fields.float('Product UoS Qty', states={'draft':[('readonly',False)]}, readonly=True),
         'product_uos': fields.many2one('product.uom', 'Product UoS', states={'draft':[('readonly',False)]}, readonly=True),
index 7c8410c..499134a 100644 (file)
                         <field name="code" select="1" string="Reference"/>
                         <newline/>
                         <field name="product_qty"/>
-                        <field name="product_uom"/>
+                        <field name="product_uom" groups="product.group_uom"/>
                         <field name="routing_id"  groups="mrp.group_mrp_routings"/>
                         <newline/>
                         <field name="product_uos_qty" groups="product.group_uos" />
                                 <tree string="Components" editable="bottom">
                                     <field name="product_id" on_change="onchange_product_id(product_id, name)" select="1"/>
                                     <field name="product_qty"/>
-                                    <field name="product_uom"/>
+                                    <field name="product_uom" groups="product.group_uom"/>
                                     <field name="name" invisible="1"/>
                                     <field name="date_start"/>
                                     <field name="date_stop"/>
                                     <field name="code" select="1" string="Reference"/>
                                     <newline/>
                                     <field name="product_qty"/>
-                                    <field name="product_uom"/>
+                                    <field name="product_uom" groups="product.group_uom"/>
                                     <field name="routing_id"  groups="mrp.group_mrp_routings"/>
                                     <newline/>
                                     <field name="product_uos_qty" groups="product.group_uos" />
                                             <tree string="Components" editable="bottom">
                                                 <field name="product_id" on_change="onchange_product_id(product_id, name)" select="1"/>
                                                 <field name="product_qty"/>
-                                                <field name="product_uom"/>
+                                                <field name="product_uom" groups="product.group_uom"/>
                                                 <field name="name" invisible="1"/>
                                                 <field name="date_start"/>
                                                 <field name="date_stop"/>
                     <field name="code"/>
                     <field name="product_id"/>
                     <field name="product_qty"/>
-                    <field name="product_uom"/>
+                    <field name="product_uom" groups="product.group_uom"/>
                     <field name="type"/>
                     <field name="method"/>
                     <field name="routing_id" groups="mrp.group_mrp_routings"/>
                     <field name="product_id" string="Component Product"/>
                     <field name="bom_id"/>
                     <field name="product_qty"/>
-                    <field name="product_uom"/>
+                    <field name="product_uom" groups="product.group_uom"/>
                     <field name="type"/>
                     <field name="method"/>
                     <field name="routing_id" groups="mrp.group_mrp_routings"/>
             <field name="arch" type="xml">
                 <form layout="manual">
                 <header>
-                    <button name="button_confirm" states="draft" string="Confirm Production"/>
-                    <button name="button_produce" states="ready" string="Start Production"/>
-                    <button name="%(act_mrp_product_produce)d" states="in_production" string="Produce" type="action"/>
+                    <button name="button_confirm" states="draft" string="Confirm Production" class="oe_form_button_hi"/>
+                    <button name="button_produce" states="ready" string="Start Production" class="oe_form_button_hi"/>
+                    <button name="%(act_mrp_product_produce)d" states="in_production" string="Produce" type="action" class="oe_form_button_hi"/>
                     <button name="force_production" states="confirmed,picking_except" string="Force Reservation" type="object"/>
                     <button name="button_recreate" states="picking_except" string="Recreate Picking"/>
                     <button name="button_cancel" states="draft,ready,in_production,picking_except" string="Cancel"/>
                         <newline/>
                         <field name="product_id" on_change="product_id_change(product_id)" domain="[('supply_method','=','produce')]"/>
                         <field name="product_qty"/>
-                        <field name="product_uom"/>
+                        <field name="product_uom" groups="product.group_uom"/>
                         <button type="action"
                             icon="terp-accessories-archiver+"
                             name="%(mrp.action_change_production_qty)d"
-                            string="Change Qty" states="ready,confirmed" />
+                            string="Change Quantity" states="ready,confirmed" />
                     </group>
                     <group colspan="4" col="4">
                         <label string="" colspan="2"/>
                         <page string="Consumed Products">
                             <field name="bom_id" domain="[('product_id','=',product_id),('bom_id','=',False)]" on_change="bom_id_change(bom_id)"/>
                             <field name="routing_id" groups="mrp.group_mrp_routings" select="1"/>
-                            <field name="location_src_id" domain="[('usage','=','internal')]" on_change="location_id_change(location_src_id,location_dest_id)"/>
-                            <field name="location_dest_id" domain="[('usage','=','internal')]"/>
+                            <field name="location_src_id" domain="[('usage','=','internal')]" on_change="location_id_change(location_src_id,location_dest_id)" groups="stock.group_locations"/>
+                            <field name="location_dest_id" domain="[('usage','=','internal')]" groups="stock.group_locations"/>
                             <separator string="" colspan="4"/>
 
                             <field colspan="2" name="move_lines" nolabel="1" widget="one2many_list"
                                 mode="tree,form" height="275" domain="[('state','&lt;&gt;', ('done', 'cancel'))]">
                                 <tree colors="blue:state == 'draft';black:state in ('picking_except','confirmed','ready','in_production');gray:state in ('cancel','done') " string="Products to Consume">
                                     <field name="product_id" />
-                                    <field name="product_qty"  string="Qty"/>
-                                    <field name="product_uom"  string="Unit of Measure"/>
-                                    <field name="location_id"  string="Source Loc."/>
+                                    <field name="product_qty"/>
+                                    <field name="product_uom"  string="Unit of Measure" groups="product.group_uom"/>
+                                    <field name="location_id"  string="Source Loc." groups="stock.group_locations"/>
                                     <field name="state" invisible="1"/>
                                     <button name="%(stock.move_consume)d"
                                         string="Consume Products" type="action"
                                        widget="one2many_list" mode="tree,form" height="275">
                                    <tree colors="red:scrapped==True;blue:state == 'draft';black:state in('picking_except','confirmed','ready','in_production');gray:state == 'cancel' " string="Consumed Products" editable="bottom">
                                        <field name="product_id" readonly="1"/>
-                                       <field name="product_qty" readonly="1" string="Qty"/>
-                                       <field name="product_uom" readonly="1" string="Unit of Measure"/>
+                                       <field name="product_qty" readonly="1"/>
+                                       <field name="product_uom" readonly="1" string="Unit of Measure" groups="product.group_uom"/>
                                        <field name="prodlot_id" context="{'product_id': product_id}"/>
                                        <field name="state" invisible="1"/>
                                        <field name="scrapped" invisible="1"/>
                             <field name="date_start"/>
                             <field name="date_finished"/>
                             <field name="picking_id"/>
-                            <field name="move_prod_id"/>
+                            <field name="move_prod_id" groups="stock.group_locations"/>
                         </page>
                     </notebook>
                 </sheet>
             <field name="view_id" eval="False"/>
             <field name="search_view_id" ref="view_mrp_production_filter"/>
             <field name="context">{}</field>
-            <field name="help">Manufacturing Orders are usually proposed automatically by OpenERP based on the bill of materials and the procurement rules, but you can also create manufacturing orders manually. OpenERP will handle the consumption of the raw materials (stock decrease) and the production of the finished products (stock increase) when the order is processed.</field>
+            <field name="help">Click here to create a new Manufacturing Order
+                &lt;p&gt;
+                To process the production, don't forget to create a Bill of Material. Manufacturing Order can be automatically generated based on procurement rules specified on the product</field>
         </record>
         <menuitem action="mrp_production_action" id="menu_mrp_production_action"
             parent="menu_mrp_manufacturing" sequence="1"/>
                     <field name="name"/>
                     <field name="product_id"/>
                     <field name="product_qty"/>
-                    <field name="product_uom"/>
+                    <field name="product_uom" groups="product.group_uom"/>
                     <field name="product_uos_qty" groups="product.group_uos"/>
                     <field name="product_uos" groups="product.group_uos"/>
                 </form>
                 <tree string="Scheduled Products">
                     <field name="product_id"/>
                     <field name="product_qty"/>
-                    <field name="product_uom"/>
+                    <field name="product_uom" groups="product.group_uom"/>
                     <field name="product_uos_qty" groups="product.group_uos"/>
                     <field name="product_uos" groups="product.group_uos"/>
                 </tree>
             <field name="arch" type="xml">
                 <group name="misc" position="after">
                     <separator string="Bill of Materials" colspan="4"/>
-                    <field name="bom_ids" nolabel="1" colspan="4" context="{'default_product_id': active_id}"/>
+                    <field name="bom_ids" nolabel="1" colspan="4" context="{'default_product_id': active_id}"  widget="one2many_list" 
+                            mode="tree,form">
+                                <tree string="Bill of Materials">
+                                     <field name="name" string="Component Name"/>
+                                    <field name="bom_id"/>
+                                    <field name="product_qty" string="Quantity of Product"/>
+                                    <field name="type"/>
+                                    <field name="date_start"/>
+                                    <field name="date_stop"/>
+                                </tree>
+                            </field>
                 </group>
             </field>
         </record>
index db313e6..1c83711 100644 (file)
@@ -550,10 +550,10 @@ class stock_warehouse_orderpoint(osv.osv):
         'location_id': fields.many2one('stock.location', 'Location', required=True, ondelete="cascade"),
         'product_id': fields.many2one('product.product', 'Product', required=True, ondelete='cascade', domain=[('type','=','product')]),
         'product_uom': fields.many2one('product.uom', 'Product Unit of Measure', required=True),
-        'product_min_qty': fields.float('Min Quantity', required=True,
+        'product_min_qty': fields.float('Minimum Quantity', required=True,
             help="When the virtual stock goes below the Min Quantity specified for this field, OpenERP generates "\
             "a procurement to bring the virtual stock to the Max Quantity."),
-        'product_max_qty': fields.float('Max Quantity', required=True,
+        'product_max_qty': fields.float('Maximum Quantity', required=True,
             help="When the virtual stock goes below the Min Quantity, OpenERP generates "\
             "a procurement to bring the virtual stock to the Quantity specified as Max Quantity."),
         'qty_multiple': fields.integer('Qty Multiple', required=True,
index 09bf0c6..1652da3 100644 (file)
                 <group name="misc" position="after">
                     <group colspan="4" attrs="{'invisible':[('type','=','service')]}" groups="stock.group_stock_manager">
                         <separator string="Minimum Stock Rules" colspan="4"/>
-                        <field name="orderpoint_ids" nolabel="1" colspan="4" context="{'default_product_id': active_id}"/>
+                        <field colspan="4" name="orderpoint_ids" nolabel="1" context="{'default_product_id': active_id}" widget="one2many_list"
+                                mode="tree,form">
+                                <tree string="Reordering Rules">
+                                    <field name="name"/>
+                                    <field name="warehouse_id"/>
+                                    <field name="product_min_qty"/>
+                                    <field name="product_max_qty"/>
+                                </tree>
+                            </field>
                     </group>
                 </group>
             </field>
index 98ae367..8eabfe5 100644 (file)
                     <field name="product_name"/>
                     <field name="product_code"/>
                     <field name="min_qty"/>
-                    <field name="product_uom"/>
+                    <field name="product_uom" groups="product.group_uom"/>
                     <field name="delay"/>
                     <field name="company_id" groups="base.group_multi_company" widget="selection"/>
                     <field colspan="4" groups="product.group_sale_pricelist" name="pricelist_ids" nolabel="1" widget="one2many_list">
                             <field colspan="4" name="seller_ids" nolabel="1"/>
                         </page>
                         <page string="Descriptions">
-                            <separator string="Description"/>
+                            <separator string="Internal Description"/>
                             <field colspan="4" name="description" nolabel="1"/>
                             <separator string="Sale Description"/>
                             <field colspan="4" name="description_sale" nolabel="1"/>
index aca84d3..8e8da9b 100644 (file)
             <field name="type">ir.actions.act_window</field>
             <field name="view_type">form</field>
             <field name="view_mode">tree,form</field>
-            <field name="domain">[('product_id','=',active_id),('picking_id.type','=','in')]</field>
+            <field name="domain">[('product_id','=',[active_id]),('picking_id.type','=','in')]</field>
             <field name="view_id" ref="view_move_tree_reception_picking"/>
             <field name="context" eval="'{\'search_default_product_id\': [active_id]}'"/>
             <field name="search_view_id" ref="view_move_search_reception_incoming_picking"/>