diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 6a708b7cc64..72ba2dc9c7f 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -1084,7 +1084,7 @@ class mrp_production_workcenter_line(osv.osv): 'cycle': fields.float('Number of Cycles', digits=(16,2)), 'hour': fields.float('Number of Hours', digits=(16,2)), 'sequence': fields.integer('Sequence', required=True, help="Gives the sequence order when displaying a list of work orders."), - 'production_id': fields.many2one('mrp.production', 'Production Order', select=True, ondelete='cascade', required=True), + 'production_id': fields.many2one('mrp.production', 'Manufacturing Order', select=True, ondelete='cascade', required=True), } _defaults = { 'sequence': lambda *a: 1, diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index 932a45bbb15..d5bc6d94507 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -784,8 +784,8 @@ - - + + diff --git a/addons/mrp_operations/mrp_operations.py b/addons/mrp_operations/mrp_operations.py index 4bca93d260f..d5cab54d231 100644 --- a/addons/mrp_operations/mrp_operations.py +++ b/addons/mrp_operations/mrp_operations.py @@ -71,6 +71,17 @@ class mrp_production_workcenter_line(osv.osv): res[op.id] = op.date_planned return res + def onchange_production_id(self, cr, uid, ids, production_id, context=None): + if not production_id: + return {} + production = self.pool.get('mrp.production').browse(cr, uid, production_id, context=None) + result = { + 'product': production.product_id.id, + 'qty': production.product_qty, + 'uom': production.product_uom.id, + } + return {'value': result} + _inherit = 'mrp.production.workcenter.line' _order = "sequence, date_planned" @@ -97,8 +108,9 @@ class mrp_production_workcenter_line(osv.osv): } _defaults = { - 'state': lambda *a: 'draft', - 'delay': lambda *a: 0.0 + 'state': 'draft', + 'delay': 0.0, + 'production_state': 'draft' } def modify_production_order_state(self, cr, uid, ids, action): diff --git a/addons/mrp_operations/mrp_operations_view.xml b/addons/mrp_operations/mrp_operations_view.xml index a16a9b23f0a..dbe5ed83d0d 100644 --- a/addons/mrp_operations/mrp_operations_view.xml +++ b/addons/mrp_operations/mrp_operations_view.xml @@ -74,9 +74,9 @@ - + - + @@ -92,7 +92,7 @@ - +