Saurang Suthar(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-product-view-tta into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-product-view-tta/+merge/104382

Hello,

BoM and minimum stock rules fields are visible directly in the product 
form,without having to click on the relate icon.

Thank you.
Saurang - ssu
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-product-view-tta/+merge/104382
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-product-view-tta.
=== modified file 'mrp/mrp.py'
--- mrp/mrp.py	2012-04-18 13:41:43 +0000
+++ mrp/mrp.py	2012-05-02 12:59:26 +0000
@@ -1120,4 +1120,11 @@
     }
 mrp_production_product_line()
 
+class product_product(osv.osv):
+    _inherit = "product.product"
+    _columns = {
+        'bom_ids': fields.one2many('mrp.bom', 'product_id', 'Bill of Materials')
+    }
+    
+product_product()
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== modified file 'mrp/mrp_view.xml'
--- mrp/mrp_view.xml	2012-04-25 14:06:25 +0000
+++ mrp/mrp_view.xml	2012-05-02 12:59:26 +0000
@@ -413,7 +413,7 @@
                         </page>
                     </notebook>
                     <newline/>
-                    <field name="message_ids_social" colspan="4" widget="ThreadView" nolabel="1"/>
+                    <!--field name="message_ids_social" colspan="4" widget="ThreadView" nolabel="1"/-->
                 </form>
             </field>
         </record>
@@ -450,7 +450,7 @@
             <field name="type">tree</field>
             <field name="field_parent">child_complete_ids</field>
             <field name="arch" type="xml">
-                <tree string="BoM Structure" colors="blue:method">
+                <tree string="Bill of Materials" colors="blue:method">
                     <field name="sequence" invisible="1"/>
                     <field name="name"/>
                     <field name="code"/>
@@ -974,7 +974,22 @@
                </data>
             </field>
         </record>
-
+		
+		<record id="product_normal_form_view" model="ir.ui.view">
+            <field name="name">product.normal.form.mrp.inherit</field>
+            <field name="model">product.product</field>
+            <field name="type">form</field>
+            <field name="inherit_id" ref="product.product_normal_form_view"/>
+            <field name="arch" type="xml">
+                  <group name="misc" position="after">
+                      <group col="2" colspan="4">
+                      	  <separator string="Bill of Materials" colspan="4"/>
+                          <field name="bom_ids" nolabel="1" context="{'default_product_id': active_id}"/>
+                      </group>
+                  </group>
+            </field>
+        </record>
+		
         <act_window
             context="{'search_default_product_id': [active_id]}"
             id="act_product_manufacturing_open"
@@ -995,15 +1010,6 @@
             src_model="product.product"
             groups="mrp.group_mrp_user"/>
 
-        <act_window
-            domain="[('bom_id','=',False)]"
-            context="{'search_default_product_id': [active_id],'default_product_id':active_id}"
-            id="act_product_product_2_mrp_bom"
-            name="Bill of Materials"
-            res_model="mrp.bom"
-            src_model="product.product"
-            groups="mrp.group_mrp_user"/>
-
         <!-- Menu for Resource for MRP-->
 
         <record id="mrp_workcenter_action" model="ir.actions.act_window">

=== modified file 'procurement/procurement.py'
--- procurement/procurement.py	2012-01-04 06:38:07 +0000
+++ procurement/procurement.py	2012-05-02 12:59:26 +0000
@@ -571,8 +571,9 @@
 class product_product(osv.osv):
     _inherit="product.product"
     _columns = {
-        'orderpoint_ids': fields.one2many('stock.warehouse.orderpoint', 'product_id', 'Minimum Stock Rule')
+        'orderpoint_ids': fields.one2many('stock.warehouse.orderpoint', 'product_id', 'Minimum Stock Rules')
     }
+    
 product_product()
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== modified file 'procurement/procurement_view.xml'
--- procurement/procurement_view.xml	2012-04-25 14:18:36 +0000
+++ procurement/procurement_view.xml	2012-05-02 12:59:26 +0000
@@ -251,15 +251,6 @@
         src_model="stock.warehouse"
         groups="stock.group_stock_user"/>
 
-        <!-- add product_uom to context to be the default value when adding new orderpoints -->
-        <act_window
-            context="{'product_uom': locals().has_key('uom_id') and uom_id,'search_default_product_id': [active_id], 'default_product_id': active_id}"
-            id="act_product_product_2_stock_warehouse_orderpoint"
-            name="Minimum Stock Rules"
-            res_model="stock.warehouse.orderpoint"
-            src_model="product.product"
-            groups="stock.group_stock_user"/>
-
         <act_window
             context="{'product_uom': locals().has_key('uom_id') and uom_id, 'default_procurement_id': active_id}"
             id="act_procurement_2_stock_warehouse_orderpoint"
@@ -275,30 +266,20 @@
         <menuitem id="menu_stock_procurement" name="Automatic Procurements" parent="stock.menu_stock_configuration" sequence="5"/>
             <menuitem action="action_orderpoint_form" id="menu_stock_order_points" parent="stock.menu_stock_configuration" sequence="10"/>
 
-
         <record id="product_normal_form_view" model="ir.ui.view">
             <field name="name">product.normal.form.orderpoint.inherit</field>
             <field name="model">product.product</field>
             <field name="type">form</field>
             <field name="inherit_id" ref="product.product_normal_form_view"/>
             <field name="arch" type="xml">
-                  <group name="misc" position="after">
-                      <group col="2" colspan="2" attrs="{'invisible':[('type', '=', 'service')]}">
-                          <separator string="Minimum Stock Rules" colspan="2"/>
-                          <field name="orderpoint_ids" context="{'default_product_uom': uom_id}" nolabel="1">
-                              <tree string="Minimum Stock Rule" editable="bottom">
-                                  <field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)" widget="selection"/>
-                                  <field name="location_id"/>
-                                  <field name="product_min_qty"/>
-                                  <field name="product_max_qty"/>
-                                  <field name="product_uom" groups="product.group_uom"/>
-                              </tree>
-                          </field>
-                      </group>
-                  </group>
+            	<group name="misc" position="after">
+                  	<separator string="Minimum Stock Rules" colspan="4"/>
+                      		<group colspan="4">
+                            	<field name="orderpoint_ids" nolabel="1" context="{'default_product_id': active_id}"/>
+                      		</group>
+            	</group>
             </field>
         </record>
-
-
+        
     </data>
 </openerp>

=== modified file 'product/product_view.xml'
--- product/product_view.xml	2012-04-25 13:56:29 +0000
+++ product/product_view.xml	2012-05-02 12:59:26 +0000
@@ -216,6 +216,7 @@
                                     </div>
                                     <div class="oe_kanban_box_content oe_kanban_color_bglight oe_kanban_box_show_onclick_trigger">
                                         <img t-att-src="kanban_image('product.product', 'product_image', record.id.value)" width="48" style="float: left; padding: 0 4px 4px 0"/>
+                                        Code: <field name="code"/>
                                         <div t-if="record.type.raw_value == 'service'">No Stock</div>
                                         <t t-if="record.type.raw_value != 'service'">
                                             <div>Stock: <field name="qty_available"/> on hand, <field name="virtual_available"/> available</div>

=== modified file 'stock/product_view.xml'
--- stock/product_view.xml	2012-04-25 13:56:29 +0000
+++ stock/product_view.xml	2012-05-02 12:59:26 +0000
@@ -145,6 +145,7 @@
                                 <div class="oe_product_desc">
                                     <h4><a type="edit"><field name="name"></field></a></h4>
                                     <ul>
+                                    	<li>Code: <field name="code"></field></li>
                                         <li t-if="record.type.raw_value != 'service'">Stock on hand: <field name="qty_available"/> <field name="uom_id"/></li>
                                         <li t-if="record.type.raw_value != 'service'">Stock available: <field name="virtual_available"/> <field name="uom_id"/></li>
                                         <li>Price: <field name="lst_price"></field></li>

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to