parent
1e5c8304ee
commit
19b5efde0d
|
@ -410,6 +410,15 @@ class mrp_production(osv.osv):
|
||||||
'name': lambda x,y,z,c: x.pool.get('ir.sequence').get(y,z,'mrp.production') or '/',
|
'name': lambda x,y,z,c: x.pool.get('ir.sequence').get(y,z,'mrp.production') or '/',
|
||||||
}
|
}
|
||||||
_order = 'date_planned asc, priority desc';
|
_order = 'date_planned asc, priority desc';
|
||||||
|
def unlink(self, cr, uid, ids):
|
||||||
|
productions = self.read(cr, uid, ids, ['state'])
|
||||||
|
unlink_ids = []
|
||||||
|
for s in productions:
|
||||||
|
if s['state'] in ['draft','cancel']:
|
||||||
|
unlink_ids.append(s['id'])
|
||||||
|
else:
|
||||||
|
raise osv.except_osv(_('Invalid action !'), _('Cannot delete Production Order(s) which are in %s State!' % s['state']))
|
||||||
|
return osv.osv.unlink(self, cr, uid, unlink_ids)
|
||||||
|
|
||||||
def location_id_change(self, cr, uid, ids, src, dest, context={}):
|
def location_id_change(self, cr, uid, ids, src, dest, context={}):
|
||||||
if dest:
|
if dest:
|
||||||
|
@ -780,8 +789,7 @@ class mrp_procurement(osv.osv):
|
||||||
unlink_ids.append(s['id'])
|
unlink_ids.append(s['id'])
|
||||||
else:
|
else:
|
||||||
raise osv.except_osv(_('Invalid action !'), _('Cannot delete Procurement Order(s) which are in %s State!' % s['state']))
|
raise osv.except_osv(_('Invalid action !'), _('Cannot delete Procurement Order(s) which are in %s State!' % s['state']))
|
||||||
osv.osv.unlink(self, cr, uid, unlink_ids)
|
return osv.osv.unlink(self, cr, uid, unlink_ids)
|
||||||
return True
|
|
||||||
|
|
||||||
def onchange_product_id(self, cr, uid, ids, product_id, context={}):
|
def onchange_product_id(self, cr, uid, ids, product_id, context={}):
|
||||||
if product_id:
|
if product_id:
|
||||||
|
|
|
@ -207,8 +207,7 @@ class purchase_order(osv.osv):
|
||||||
unlink_ids.append(s['id'])
|
unlink_ids.append(s['id'])
|
||||||
else:
|
else:
|
||||||
raise osv.except_osv(_('Invalid action !'), _('Cannot delete Purchase Order(s) which are in %s State!' % s['state']))
|
raise osv.except_osv(_('Invalid action !'), _('Cannot delete Purchase Order(s) which are in %s State!' % s['state']))
|
||||||
osv.osv.unlink(self, cr, uid, unlink_ids)
|
return osv.osv.unlink(self, cr, uid, unlink_ids)
|
||||||
return True
|
|
||||||
|
|
||||||
def button_dummy(self, cr, uid, ids, context={}):
|
def button_dummy(self, cr, uid, ids, context={}):
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -261,8 +261,7 @@ class sale_order(osv.osv):
|
||||||
unlink_ids.append(s['id'])
|
unlink_ids.append(s['id'])
|
||||||
else:
|
else:
|
||||||
raise osv.except_osv(_('Invalid action !'), _('Cannot delete Sale Order(s) which are already confirmed !'))
|
raise osv.except_osv(_('Invalid action !'), _('Cannot delete Sale Order(s) which are already confirmed !'))
|
||||||
osv.osv.unlink(self, cr, uid, unlink_ids)
|
return osv.osv.unlink(self, cr, uid, unlink_ids)
|
||||||
return True
|
|
||||||
|
|
||||||
def onchange_shop_id(self, cr, uid, ids, shop_id):
|
def onchange_shop_id(self, cr, uid, ids, shop_id):
|
||||||
v={}
|
v={}
|
||||||
|
|
Loading…
Reference in New Issue