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/103691
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/103691
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-04-26 13:31:09 +0000
@@ -1120,4 +1120,10 @@
}
mrp_production_product_line()
+class product_product(osv.osv):
+ _inherit="product.product"
+ _columns = {
+ 'bom_ids': fields.one2many('mrp.bom', 'product_id', 'Bill of Material')
+ }
+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-04-26 13:31:09 +0000
@@ -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,23 @@
</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="store" position="after">
+ <group col="2" colspan="4">
+ <separator string="Bill of Materials" colspan="4"/>
+ <field name="bom_ids" nolabel="1" domain="[('bom_id','=',False)]">
+ </field>
+ </group>
+ </group>
+ </field>
+ </record>
+
<act_window
context="{'search_default_product_id': [active_id]}"
id="act_product_manufacturing_open"
@@ -995,15 +1011,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_view.xml'
--- procurement/procurement_view.xml 2012-04-25 14:18:36 +0000
+++ procurement/procurement_view.xml 2012-04-26 13:31:09 +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"
@@ -283,8 +274,8 @@
<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"/>
+ <group col="2" colspan="4" attrs="{'invisible':[('type', '=', 'service')]}">
+ <separator string="Minimum Stock Rules" colspan="4"/>
<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"/>
=== modified file 'product/product_view.xml'
--- product/product_view.xml 2012-04-25 13:56:29 +0000
+++ product/product_view.xml 2012-04-26 13:31:09 +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.py'
--- stock/product.py 2012-02-13 15:27:55 +0000
+++ stock/product.py 2012-04-26 13:31:09 +0000
@@ -398,6 +398,8 @@
help="If real-time valuation is enabled for a product, the system will automatically write journal entries corresponding to stock moves." \
"The inventory variation account set on the product category will represent the current inventory value, and the stock input and stock output account will hold the counterpart moves for incoming and outgoing products."
, required=True),
+ 'minimum_stock_rule': fields.one2many('stock.warehouse.orderpoint','product_id','Minimum Stock Rules', help="This is Minimum Stock Rule"),
+ 'bill_of_material': fields.one2many('mrp.bom','product_id','Bill Of Materials', help="This is Bill of Materials"),
}
_defaults = {
=== modified file 'stock/product_view.xml'
--- stock/product_view.xml 2012-04-25 13:56:29 +0000
+++ stock/product_view.xml 2012-04-26 13:31:09 +0000
@@ -116,6 +116,12 @@
<field name="incoming_qty"/>
<field name="outgoing_qty"/>
</group>
+ <group colspan="4">
+ <field name="minimum_stock_rule" nolabel="1" context="{'default_product_id': active_id}"/>
+ </group>
+ <group colspan="4">
+ <field name="bill_of_material" nolabel="1" context="{'default_product_id': active_id}"/>
+ </group>
<group colspan="2" col="2" name="lot" groups="stock.group_tracking_lot,stock.group_production_lot">
<separator string="Lots" colspan="4"/>
<field name="track_production" groups="stock.group_production_lot"/>
@@ -145,6 +151,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