[IMP] mrp, mrp_operations: Improved code and removed unnecessary statements.
bzr revid: uco@tinyerp.com-20100715103213-m0bhsv98dhm0ap6r
This commit is contained in:
parent
d6a635107c
commit
5249b531cd
|
@ -561,12 +561,14 @@ class mrp_production(osv.osv):
|
|||
if not product:
|
||||
return {'value': {
|
||||
'product_uom': False,
|
||||
'bom_id': False
|
||||
'bom_id': False,
|
||||
'routing_id': False
|
||||
}}
|
||||
res = self.pool.get('product.product').browse(cr, uid, product, context=context)
|
||||
result = {
|
||||
'product_uom': res.uom_id and res.uom_id.id or False,
|
||||
'bom_id': res.bom_ids and res.bom_ids[0].id or False
|
||||
'bom_id': res.bom_ids and res.bom_ids[0].id or False,
|
||||
'routing_id': res.bom_ids and res.bom_ids[0].routing_id.id or False
|
||||
}
|
||||
return {'value': result}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ class mrp_production_workcenter_line(osv.osv):
|
|||
"""
|
||||
res = {}
|
||||
for op in self.browse(cr, uid, ids, context=context):
|
||||
res[op.id]= False
|
||||
res[op.id] = False
|
||||
if op.date_planned:
|
||||
d = DateTime.strptime(op.date_planned,'%Y-%m-%d %H:%M:%S')
|
||||
i = self.pool.get('resource.calendar').interval_get(cr, uid, op.workcenter_id.calendar_id.id or False, d, op.hour or 0.0)
|
||||
|
@ -224,8 +224,6 @@ class mrp_production(osv.osv):
|
|||
obj = self.browse(cr, uid, ids)[0]
|
||||
for workcenter_line in obj.workcenter_lines:
|
||||
tmp = self.pool.get('mrp.production.workcenter.line').action_done(cr, uid, [workcenter_line.id])
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_done', cr)
|
||||
return super(mrp_production,self).action_production_end(cr, uid, ids)
|
||||
|
||||
def action_in_production(self, cr, uid, ids):
|
||||
|
@ -236,8 +234,6 @@ class mrp_production(osv.osv):
|
|||
workcenter_line_obj = self.pool.get('mrp.production.workcenter.line')
|
||||
for workcenter_line in obj.workcenter_lines:
|
||||
workcenter_line_obj.action_start_working(cr, uid, [workcenter_line.id])
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_start_working', cr)
|
||||
return super(mrp_production,self).action_in_production(cr, uid, ids)
|
||||
|
||||
def action_cancel(self, cr, uid, ids):
|
||||
|
@ -247,8 +243,6 @@ class mrp_production(osv.osv):
|
|||
obj = self.browse(cr, uid, ids)[0]
|
||||
for workcenter_line in obj.workcenter_lines:
|
||||
tmp = self.pool.get('mrp.production.workcenter.line').action_cancel(cr, uid, [workcenter_line.id])
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_cancel', cr)
|
||||
return super(mrp_production,self).action_cancel(cr,uid,ids)
|
||||
|
||||
def _compute_planned_workcenter(self, cr, uid, ids, context={}, mini=False):
|
||||
|
|
Loading…
Reference in New Issue