[IMP] procurement: Move the mrp.property into mrp

bzr revid: sbh@tinyerp.com-20100707091851-cf0zbq0rr8ce4qgu
This commit is contained in:
sbh (Open ERP) 2010-07-07 14:48:51 +05:30
parent bfc4a3a021
commit 88f8ef366a
7 changed files with 68 additions and 46 deletions

View File

@ -27,6 +27,35 @@ import ir
import netsvc
import time
class mrp_property_group(osv.osv):
"""
Group of mrp properties.
"""
_name = 'mrp.property.group'
_description = 'Property Group'
_columns = {
'name': fields.char('Property Group', size=64, required=True),
'description': fields.text('Description'),
}
mrp_property_group()
class mrp_property(osv.osv):
"""
Properties of mrp.
"""
_name = 'mrp.property'
_description = 'Property'
_columns = {
'name': fields.char('Name', size=64, required=True),
'composition': fields.selection([('min','min'),('max','max'),('plus','plus')], 'Properties composition', required=True, help="Not used in computations, for information purpose only."),
'group_id': fields.many2one('mrp.property.group', 'Property Group', required=True),
'description': fields.text('Description'),
}
_defaults = {
'composition': lambda *a: 'min',
}
mrp_property()
#----------------------------------------------------------
# Work Centers
#----------------------------------------------------------

View File

@ -882,10 +882,40 @@
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='move_id']" position="before">
<field name="bom_id" domain="[('product_id','=',product_id),('bom_id','=',False)]"/>
<group colspan="4" groups="base.group_extended">
<separator colspan="4" string="Properties" />
<field colspan="4" name="property_ids" nolabel="1"/>
</group>
</xpath>
</field>
</record>
<record id="view_procurement_form_inherit" model="ir.ui.view">
<field name="name">procurement.order.form.inherit</field>
<field name="model">procurement.order</field>
<field name="inherit_id" ref="procurement.procurement_form_view"/>
<field name="type">form</field>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='move_id']" position="before">
<field name="bom_id" domain="[('product_id','=',product_id),('bom_id','=',False)]"/>
</xpath>
</field>
</record>
<record id="view_procurement_form_inherit_property" model="ir.ui.view">
<field name="name">procurement.order.form.inherit</field>
<field name="model">procurement.order</field>
<field name="inherit_id" ref="procurement.procurement_form_view"/>
<field name="type">form</field>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='close_move']" position="after">
<group colspan="4" groups="base.group_extended">
<separator colspan="4" string="Properties" />
<field colspan="4" name="property_ids" nolabel="1"/>
</group>
</xpath>
</field>
</record>
<act_window
id="action_product_bom_structure"
name="Product BoM Structure"

View File

@ -31,6 +31,7 @@ class procurement_order(osv.osv):
_inherit = 'procurement.order'
_columns = {
'bom_id': fields.many2one('mrp.bom', 'BoM', ondelete='cascade', select=True),
'property_ids': fields.many2many('mrp.property', 'procurement_property_rel', 'procurement_id','property_id', 'Properties'),
}
def check_produce_product(self, cr, uid, procurement, context=[]):

View File

@ -28,3 +28,7 @@
"access_report_workcenter_load","report.workcenter.load","model_report_workcenter_load","mrp.group_mrp_manager",1,0,0,0
"access_report_mrp_inout","report.mrp.inout","model_report_mrp_inout","mrp.group_mrp_manager",1,0,0,0
"access_product_product_manager","product.product manager","model_product_product","mrp.group_mrp_manager",1,1,1,1
"access_mrp_property_group","mrp.property.group","model_mrp_property_group","stock.group_stock_manager",1,1,1,1
"access_mrp_property","mrp.property","model_mrp_property","stock.group_stock_manager",1,1,1,1
"access_mrp_property_group","mrp.property.group","model_mrp_property_group","base.group_user",1,0,0,0
"access_mrp_property","mrp.property","model_mrp_property","base.group_user",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
28 access_report_workcenter_load report.workcenter.load model_report_workcenter_load mrp.group_mrp_manager 1 0 0 0
29 access_report_mrp_inout report.mrp.inout model_report_mrp_inout mrp.group_mrp_manager 1 0 0 0
30 access_product_product_manager product.product manager model_product_product mrp.group_mrp_manager 1 1 1 1
31 access_mrp_property_group mrp.property.group model_mrp_property_group stock.group_stock_manager 1 1 1 1
32 access_mrp_property mrp.property model_mrp_property stock.group_stock_manager 1 1 1 1
33 access_mrp_property_group mrp.property.group model_mrp_property_group base.group_user 1 0 0 0
34 access_mrp_property mrp.property model_mrp_property base.group_user 1 0 0 0

View File

@ -25,37 +25,6 @@ from tools.translate import _
import netsvc
import time
class mrp_property_group(osv.osv):
"""
Group of mrp properties.
"""
_name = 'mrp.property.group'
_description = 'Property Group'
_columns = {
'name': fields.char('Property Group', size=64, required=True),
'description': fields.text('Description'),
}
mrp_property_group()
class mrp_property(osv.osv):
"""
Properties of mrp.
"""
_name = 'mrp.property'
_description = 'Property'
_columns = {
'name': fields.char('Name', size=64, required=True),
'composition': fields.selection([('min','min'),('max','max'),('plus','plus')], 'Properties composition', required=True, help="Not used in computations, for information purpose only."),
'group_id': fields.many2one('mrp.property.group', 'Property Group', required=True),
'description': fields.text('Description'),
}
_defaults = {
'composition': lambda *a: 'min',
}
mrp_property()
# ------------------------------------------------------------------
# Procurement
# ------------------------------------------------------------------
#
@ -91,9 +60,6 @@ class procurement_order(osv.osv):
" a make to order method."),
'note': fields.text('Note'),
'property_ids': fields.many2many('mrp.property', 'procurement_property_rel', 'procurement_id','property_id', 'Properties'),
'message': fields.char('Latest error', size=64, help="Exception occurred while computing procurement orders."),
'state': fields.selection([
('draft','Draft'),
@ -477,7 +443,7 @@ class stock_warehouse_orderpoint(osv.osv):
help="When the virtual stock goes belong the Min Quantity, Open ERP generates "\
"a procurement to bring the virtual stock to the Max Quantity."),
'product_max_qty': fields.float('Max Quantity', required=True,
help="When the virtual stock goes belong the Min Quantity, Open ERP generates "\
help="When the virtual stock goes belong the Mix Quantity, Open ERP generates "\
"a procurement to bring the virtual stock to the Max Quantity."),
'qty_multiple': fields.integer('Qty Multiple', required=True,
help="The procurement quantity will by rounded up to this multiple."),

View File

@ -67,10 +67,6 @@
<field name="move_id" groups="base.group_extended"/>
<field name="date_close"/>
<field name="close_move" groups="base.group_extended"/>
<group colspan="4" groups="base.group_extended">
<separator colspan="4" string="Properties" />
<field colspan="4" name="property_ids" nolabel="1"/>
</group>
</page>
<page string="Notes">
<separator colspan="4" string="Note" />

View File

@ -1,7 +1,3 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_mrp_property_group","mrp.property.group","model_mrp_property_group",stock.group_stock_manager,1,1,1,1
"access_mrp_property","mrp.property","model_mrp_property",stock.group_stock_manager,1,1,1,1
"access_mrp_property_group","mrp.property.group","model_mrp_property_group",,1,0,0,0
"access_mrp_property","mrp.property","model_mrp_property",base.group_user,1,0,0,0
"access_procurement","procurement.order","model_procurement_order",base.group_user,1,0,0,0
"access_stock_warehouse_orderpoint","stock.warehouse.orderpoint","model_stock_warehouse_orderpoint",stock.group_stock_manager,1,1,1,1
"access_procurement","procurement.order","model_procurement_order","base.group_user",1,0,0,0
"access_stock_warehouse_orderpoint","stock.warehouse.orderpoint","model_stock_warehouse_orderpoint","stock.group_stock_manager",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_mrp_property_group access_procurement mrp.property.group procurement.order model_mrp_property_group model_procurement_order stock.group_stock_manager base.group_user 1 1 0 1 0 1 0
3 access_mrp_property access_stock_warehouse_orderpoint mrp.property stock.warehouse.orderpoint model_mrp_property model_stock_warehouse_orderpoint stock.group_stock_manager 1 1 1 1
access_mrp_property_group mrp.property.group model_mrp_property_group 1 0 0 0
access_mrp_property mrp.property model_mrp_property base.group_user 1 0 0 0
access_procurement procurement.order model_procurement_order base.group_user 1 0 0 0
access_stock_warehouse_orderpoint stock.warehouse.orderpoint model_stock_warehouse_orderpoint stock.group_stock_manager 1 1 1 1