[IMP] mrp_byproduct : Renamed 'subproduct' to 'byproduct'.
bzr revid: mdi@tinyerp.com-20121008102836-rwd3ooy413yxqou8
This commit is contained in:
parent
39eea5b86c
commit
31336151de
|
@ -18,5 +18,5 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
import mrp_subproduct
|
import mrp_byproduct
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -21,14 +21,14 @@
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
'name': 'MRP Subproducts',
|
'name': 'MRP Byproducts',
|
||||||
'version': '1.0',
|
'version': '1.0',
|
||||||
'category': 'Manufacturing',
|
'category': 'Manufacturing',
|
||||||
'description': """
|
'description': """
|
||||||
This module allows you to produce several products from one production order.
|
This module allows you to produce several products from one production order.
|
||||||
=============================================================================
|
=============================================================================
|
||||||
|
|
||||||
You can configure sub-products in the bill of material.
|
You can configure by-products in the bill of material.
|
||||||
|
|
||||||
Without this module:
|
Without this module:
|
||||||
--------------------
|
--------------------
|
||||||
|
@ -40,14 +40,14 @@ With this module:
|
||||||
""",
|
""",
|
||||||
'author': 'OpenERP SA',
|
'author': 'OpenERP SA',
|
||||||
'website': 'http://www.openerp.com',
|
'website': 'http://www.openerp.com',
|
||||||
'images': ['images/bom_subproduct.jpeg'],
|
'images': ['images/bom_byproduct.jpeg'],
|
||||||
'depends': ['base', 'mrp'],
|
'depends': ['base', 'mrp'],
|
||||||
'data': [
|
'data': [
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
'mrp_subproduct_view.xml'
|
'mrp_byproduct_view.xml'
|
||||||
],
|
],
|
||||||
'demo': [],
|
'demo': [],
|
||||||
'test': ['test/mrp_subproduct.yml'],
|
'test': ['test/mrp_byproduct.yml'],
|
||||||
'installable': True,
|
'installable': True,
|
||||||
'auto_install': False,
|
'auto_install': False,
|
||||||
}
|
}
|
|
@ -30,10 +30,10 @@ class mrp_subproduct(osv.osv):
|
||||||
'product_id': fields.many2one('product.product', 'Product', required=True),
|
'product_id': fields.many2one('product.product', 'Product', required=True),
|
||||||
'product_qty': fields.float('Product Qty', digits_compute=dp.get_precision('Product Unit of Measure'), required=True),
|
'product_qty': fields.float('Product Qty', digits_compute=dp.get_precision('Product Unit of Measure'), required=True),
|
||||||
'product_uom': fields.many2one('product.uom', 'Product Unit of Measure', required=True),
|
'product_uom': fields.many2one('product.uom', 'Product Unit of Measure', required=True),
|
||||||
'subproduct_type': fields.selection([('fixed','Fixed'),('variable','Variable')], 'Quantity Type', required=True, help="Define how the quantity of subproducts will be set on the production orders using this BoM.\
|
'subproduct_type': fields.selection([('fixed','Fixed'),('variable','Variable')], 'Quantity Type', required=True, help="Define how the quantity of byproducts will be set on the production orders using this BoM.\
|
||||||
'Fixed' depicts a situation where the quantity of created subproduct is always equal to the quantity set on the BoM, regardless of how many are created in the production order.\
|
'Fixed' depicts a situation where the quantity of created byproduct is always equal to the quantity set on the BoM, regardless of how many are created in the production order.\
|
||||||
By opposition, 'Variable' means that the quantity will be computed as\
|
By opposition, 'Variable' means that the quantity will be computed as\
|
||||||
'(quantity of subproduct set on the BoM / quantity of manufactured product set on the BoM * quantity of manufactured product in the production order.)'"),
|
'(quantity of byproduct set on the BoM / quantity of manufactured product set on the BoM * quantity of manufactured product in the production order.)'"),
|
||||||
'bom_id': fields.many2one('mrp.bom', 'BoM'),
|
'bom_id': fields.many2one('mrp.bom', 'BoM'),
|
||||||
}
|
}
|
||||||
_defaults={
|
_defaults={
|
||||||
|
@ -59,7 +59,7 @@ class mrp_bom(osv.osv):
|
||||||
_inherit='mrp.bom'
|
_inherit='mrp.bom'
|
||||||
|
|
||||||
_columns={
|
_columns={
|
||||||
'sub_products':fields.one2many('mrp.subproduct', 'bom_id', 'sub_products'),
|
'sub_products':fields.one2many('mrp.subproduct', 'bom_id', 'Byproducts'),
|
||||||
}
|
}
|
||||||
|
|
||||||
mrp_bom()
|
mrp_bom()
|
||||||
|
@ -106,7 +106,7 @@ class mrp_production(osv.osv):
|
||||||
def _get_subproduct_factor(self, cr, uid, production_id, move_id=None, context=None):
|
def _get_subproduct_factor(self, cr, uid, production_id, move_id=None, context=None):
|
||||||
"""Compute the factor to compute the qty of procucts to produce for the given production_id. By default,
|
"""Compute the factor to compute the qty of procucts to produce for the given production_id. By default,
|
||||||
it's always equal to the quantity encoded in the production order or the production wizard, but with
|
it's always equal to the quantity encoded in the production order or the production wizard, but with
|
||||||
the module mrp_subproduct installed it can differ for subproducts having type 'variable'.
|
the module mrp_byproduct installed it can differ for byproducts having type 'variable'.
|
||||||
:param production_id: ID of the mrp.order
|
:param production_id: ID of the mrp.order
|
||||||
:param move_id: ID of the stock move that needs to be produced. Identify the product to produce.
|
:param move_id: ID of the stock move that needs to be produced. Identify the product to produce.
|
||||||
:return: The factor to apply to the quantity that we should produce for the given production order and stock move.
|
:return: The factor to apply to the quantity that we should produce for the given production order and stock move.
|
|
@ -7,15 +7,15 @@
|
||||||
<field name="inherit_id" ref="mrp.mrp_bom_form_view"/>
|
<field name="inherit_id" ref="mrp.mrp_bom_form_view"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<notebook position="inside">
|
<notebook position="inside">
|
||||||
<page string="Sub Products" position="inside">
|
<page string="Byproducts" position="inside">
|
||||||
<field name="sub_products">
|
<field name="sub_products">
|
||||||
<tree string="sub products" editable="top">
|
<tree string="Byproducts" editable="top">
|
||||||
<field name="product_id" on_change="onchange_product_id(product_id)"/>
|
<field name="product_id" on_change="onchange_product_id(product_id)"/>
|
||||||
<field name="product_uom" groups="product.group_uom"/>
|
<field name="product_uom" groups="product.group_uom"/>
|
||||||
<field name="product_qty"/>
|
<field name="product_qty"/>
|
||||||
<field name="subproduct_type"/>
|
<field name="subproduct_type"/>
|
||||||
</tree>
|
</tree>
|
||||||
<form string="Sub Products">
|
<form string="Byproducts">
|
||||||
<field name="product_id" on_change="onchange_product_id(product_id)"/>
|
<field name="product_id" on_change="onchange_product_id(product_id)"/>
|
||||||
<field name="product_uom" groups="product.group_uom"/>
|
<field name="product_uom" groups="product.group_uom"/>
|
||||||
<field name="product_qty"/>
|
<field name="product_qty"/>
|
Loading…
Reference in New Issue