[IMP]:improved code for creating minimum stock rule and taking current product in BoM in product form view
bzr revid: ssu@tinyerp.com-20120502113432-1xgak350n58lbwyu
This commit is contained in:
+3
-2
@@ -1121,9 +1121,10 @@ class mrp_production_product_line(osv.osv):
|
||||
mrp_production_product_line()
|
||||
|
||||
class product_product(osv.osv):
|
||||
_inherit="product.product"
|
||||
_inherit = "product.product"
|
||||
_columns = {
|
||||
'bom_ids': fields.one2many('mrp.bom', 'product_id', 'Bill of Material')
|
||||
'bom_ids': fields.one2many('mrp.bom', 'product_id', 'Bill of Materials')
|
||||
}
|
||||
|
||||
product_product()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -984,8 +984,7 @@
|
||||
<group name="misc" 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>
|
||||
<field name="bom_ids" nolabel="1" context="{'default_product_id': active_id}"/>
|
||||
</group>
|
||||
</group>
|
||||
</field>
|
||||
|
||||
@@ -571,8 +571,9 @@ stock_warehouse_orderpoint()
|
||||
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:
|
||||
|
||||
@@ -266,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="4" attrs="{'invisible':[('type', '=', 'service')]}">
|
||||
<separator string="Minimum Stock Rules" colspan="4"/>
|
||||
<field name="orderpoint_ids" context="{'default_product_uom': uom_id, 'default_product_id': active_id}" nolabel="1">
|
||||
<tree string="Minimum Stock Rules" 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>
|
||||
|
||||
Reference in New Issue
Block a user