[IMP]MRP : Warning Messages are changed
bzr revid: hsa@tinyerp.com-20120712064359-rfoj2ol3stj4j4yc
This commit is contained in:
parent
6cbb04758a
commit
d953d45de4
|
@ -620,7 +620,7 @@ class mrp_production(osv.osv):
|
||||||
self.write(cr, uid, [production.id], {'bom_id': bom_id, 'routing_id': routing_id})
|
self.write(cr, uid, [production.id], {'bom_id': bom_id, 'routing_id': routing_id})
|
||||||
|
|
||||||
if not bom_id:
|
if not bom_id:
|
||||||
raise osv.except_osv(_('Error'), _("Couldn't find a bill of material for this product."))
|
raise osv.except_osv(_('Error'), _("Cannot find a bill of material for this product."))
|
||||||
factor = uom_obj._compute_qty(cr, uid, production.product_uom.id, production.product_qty, bom_point.product_uom.id)
|
factor = uom_obj._compute_qty(cr, uid, production.product_uom.id, production.product_qty, bom_point.product_uom.id)
|
||||||
res = bom_obj._bom_explode(cr, uid, bom_point, factor / bom_point.product_qty, properties, routing_id=production.routing_id.id)
|
res = bom_obj._bom_explode(cr, uid, bom_point, factor / bom_point.product_qty, properties, routing_id=production.routing_id.id)
|
||||||
results = res[0]
|
results = res[0]
|
||||||
|
@ -643,7 +643,7 @@ class mrp_production(osv.osv):
|
||||||
for production in self.browse(cr, uid, ids, context=context):
|
for production in self.browse(cr, uid, ids, context=context):
|
||||||
if production.state == 'confirmed' and production.picking_id.state not in ('draft', 'cancel'):
|
if production.state == 'confirmed' and production.picking_id.state not in ('draft', 'cancel'):
|
||||||
raise osv.except_osv(
|
raise osv.except_osv(
|
||||||
_('Could not cancel manufacturing order !'),
|
_('Cannot cancel manufacturing order.'),
|
||||||
_('You must first cancel related internal picking attached to this manufacturing order.'))
|
_('You must first cancel related internal picking attached to this manufacturing order.'))
|
||||||
if production.move_created_ids:
|
if production.move_created_ids:
|
||||||
move_obj.action_cancel(cr, uid, [x.id for x in production.move_created_ids])
|
move_obj.action_cancel(cr, uid, [x.id for x in production.move_created_ids])
|
||||||
|
|
|
@ -80,12 +80,12 @@ class change_production_qty(osv.osv_memory):
|
||||||
if not bom_point:
|
if not bom_point:
|
||||||
bom_id = bom_obj._bom_find(cr, uid, prod.product_id.id, prod.product_uom.id)
|
bom_id = bom_obj._bom_find(cr, uid, prod.product_id.id, prod.product_uom.id)
|
||||||
if not bom_id:
|
if not bom_id:
|
||||||
raise osv.except_osv(_('Error'), _("Couldn't find bill of material for product"))
|
raise osv.except_osv(_('Error'), _("Cannot find bill of material for product."))
|
||||||
prod_obj.write(cr, uid, [prod.id], {'bom_id': bom_id})
|
prod_obj.write(cr, uid, [prod.id], {'bom_id': bom_id})
|
||||||
bom_point = bom_obj.browse(cr, uid, [bom_id])[0]
|
bom_point = bom_obj.browse(cr, uid, [bom_id])[0]
|
||||||
|
|
||||||
if not bom_id:
|
if not bom_id:
|
||||||
raise osv.except_osv(_('Error'), _("Couldn't find bill of material for product"))
|
raise osv.except_osv(_('Error'), _("Cannot find bill of material for product."))
|
||||||
|
|
||||||
factor = prod.product_qty * prod.product_uom.factor / bom_point.product_uom.factor
|
factor = prod.product_qty * prod.product_uom.factor / bom_point.product_uom.factor
|
||||||
res = bom_obj._bom_explode(cr, uid, bom_point, factor / bom_point.product_qty, [])
|
res = bom_obj._bom_explode(cr, uid, bom_point, factor / bom_point.product_qty, [])
|
||||||
|
|
|
@ -513,7 +513,7 @@ class mrp_operations_operation(osv.osv):
|
||||||
code_lst.append(oper.code_id.start_stop)
|
code_lst.append(oper.code_id.start_stop)
|
||||||
if code.start_stop=='start':
|
if code.start_stop=='start':
|
||||||
if 'start' in code_lst:
|
if 'start' in code_lst:
|
||||||
raise osv.except_osv(_('Sorry!'),_('Operation has already started !' 'Youcan either Pause/Finish/Cancel the operation'))
|
raise osv.except_osv(_('Sorry!'),_('Operation has already started !' 'You can either Pause/Finish/Cancel the operation.'))
|
||||||
return False
|
return False
|
||||||
if code.start_stop=='pause':
|
if code.start_stop=='pause':
|
||||||
if code_lst[len(code_lst)-1]!='resume' and code_lst[len(code_lst)-1]!='start':
|
if code_lst[len(code_lst)-1]!='resume' and code_lst[len(code_lst)-1]!='start':
|
||||||
|
|
Loading…
Reference in New Issue