[MERGE] mrp usability

bzr revid: qdp-launchpad@openerp.com-20121212111001-4ozzlwc46kue2982
This commit is contained in:
Quentin (OpenERP)
2012-12-12 12:10:01 +01:00
4 changed files with 20 additions and 8 deletions
+1 -1
View File
@@ -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,
+2 -2
View File
@@ -784,8 +784,8 @@
<group>
<group>
<field name="priority"/>
<field name="date_start"/>
<field name="date_finished"/>
<field name="date_start" invisible="1"/>
<field name="date_finished" invisible="1"/>
</group>
<group>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
+14 -2
View File
@@ -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):
@@ -74,9 +74,9 @@
</header>
<sheet string="Work Orders">
<group col="4">
<field colspan="4" name="name"/>
<field colspan="2" name="name"/>
<field name="workcenter_id"/>
<field name="production_id"/>
<field name="production_id" on_change="onchange_production_id(production_id)"/>
<field name="production_state"/>
<field name="sequence"/>
</group>
@@ -92,7 +92,7 @@
<field name="cycle"/>
<field name="hour" widget="float_time"/>
</group>
<group string="Real" >
<group string="Actual Production Date" >
<field name="date_start" readonly="1"/>
<field name="date_finished" readonly="1"/>
<field name="delay" widget="float_time"/>