(self, cr, uid, ids, context=None)
return super(sale_order_line, self).unlink(cr, uid, ids, context=context)
Allows to delete sales order lines in draft,cancel states
Allows to delete sales order lines in draft,cancel states
Allows to delete sales order lines in draft cancel states
def unlink(self, cr, uid, ids, context=None):
        if context is None:
            context = {}
        """Allows to delete sales order lines in draft,cancel states"""
        for rec in self.browse(cr, uid, ids, context=context):
            if rec.state not in ['draft', 'cancel']:
                raise osv.except_osv(_('Invalid Action!'), _('Cannot delete a sales order line which is in state \'%s\'.') %(rec.state,))
        return super(sale_order_line, self).unlink(cr, uid, ids, context=context)
def unlink ( self , cr , uid , ids , context = None ) : if context is None : context = { } for rec in self . browse ( cr , uid , ids , context = context ) : if rec . state not in [ 'draft' , 'cancel' ] : raise osv . except_osv ( _ ( 'Invalid Action!' ) , _ ( 'Cannot delete a sales order line which is in state \'%s\'.' ) % ( rec . state , ) ) return super ( sale_order_line , self ) . unlink ( cr , uid , ids , context = context )